From 21f551a2c1930c4c33716c493065fe1d3ffffd21 Mon Sep 17 00:00:00 2001 From: salles Date: Tue, 11 Sep 2007 19:49:18 +0200 Subject: [PATCH] Indentation + tentative de specification du charset darcs-hash:20070911174918-72cb0-0ab25b84135183c58231634723baba1416e9750b.gz --- syncmail | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/syncmail b/syncmail index a115e12f..db484b02 100755 --- a/syncmail +++ b/syncmail @@ -145,7 +145,7 @@ NOVERSION = "Couldn't generate diff; no version number found for file: %s" BACKSLASH = "Couldn't generate diff: backslash in filespec's filename: %s" - + def usage(code, msg=''): print __doc__ % globals() if msg: @@ -153,7 +153,7 @@ def usage(code, msg=''): sys.exit(code) - + def calculate_diff(entry, contextlines): file = entry.name oldrev = entry.revision @@ -222,7 +222,7 @@ def calculate_diff(entry, contextlines): return string.join(lines, '') - + rfc822_specials_re = re.compile(r'[\(\)\<\>\@\,\;\:\\\"\.\[\]]') def quotename(name): @@ -232,7 +232,7 @@ def quotename(name): return name - + def blast_mail(subject, people, entries, contextlines, fromhost, replyto, charset): # cannot wait for child process or that will cause parent to retain cvs # lock for too long. Urg! @@ -245,7 +245,7 @@ def blast_mail(subject, people, entries, contextlines, fromhost, replyto, charse conn.connect(MAILHOST, MAILPORT) user = pwd.getpwuid(os.getuid())[0] name = string.split(pwd.getpwuid(os.getuid())[4], ',')[0] - + # Modif pour avoir le bon from (=> signature automatique) if user=="root" : for proc in os.popen("ps --no-headers -o user -t $(ps --no-headers -o tty %s)" % os.getpid() ).readlines() : @@ -255,7 +255,7 @@ def blast_mail(subject, people, entries, contextlines, fromhost, replyto, charse name = string.split(pwd.getpwnam(user)[4], ',')[0] domain = fromhost or getfqdn() - host = string.split(domain,'.')[0] + host = string.split(domain,'.')[0] address = '%s@crans.org' % user s = StringIO() sys.stdout = s @@ -266,7 +266,7 @@ def blast_mail(subject, people, entries, contextlines, fromhost, replyto, charse 'name' : quotename(name), 'people' : string.join(people, COMMASPACE), 'subject' : subject, - 'host' : host, + 'host' : host, 'version' : __version__, 'date' : datestamp, } @@ -296,7 +296,7 @@ X-Mailer: Python syncmail %(version)s os._exit(0) - + class CVSEntry: def __init__(self, name, revision, timestamp, conflict, options, tagdate): self.name = name @@ -398,13 +398,13 @@ def main(): # XXX Should really move all the options to an object, just to # avoid threading so many positional args through everything. if '- Imported sources NONE NONE' in sys.argv[1:] : - # Cas d'un cvs import - print "Syncmail : import ignorés" - sys.exit(0) + # Cas d'un cvs import + print "Syncmail : import ignorés" + sys.exit(0) if '- New directory NONE NONE' in sys.argv[1:] : - # Cas de l'ajout d'un répertoir - print "Syncmail : ajout de répertoires ignorés" - sys.exit(0) + # Cas de l'ajout d'un répertoir + print "Syncmail : ajout de répertoires ignorés" + sys.exit(0) try: opts, args = getopt.getopt( sys.argv[1:], 'hC:cuS:R:qf:m:', @@ -419,7 +419,7 @@ def main(): verbose = 1 subject_prefix = "" replyto = None - charset = None + charset = 'iso-8859-15' fromhost = None for opt, arg in opts: if opt in ('-h', '--help'): @@ -480,7 +480,7 @@ def main(): print 'Generating notification message... done.' - + if __name__ == '__main__': main() sys.exit(0)