Indentation + tentative de specification du charset
darcs-hash:20070911174918-72cb0-0ab25b84135183c58231634723baba1416e9750b.gz
This commit is contained in:
parent
22a0a252a9
commit
21f551a2c1
1 changed files with 16 additions and 16 deletions
30
syncmail
30
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"
|
BACKSLASH = "Couldn't generate diff: backslash in filespec's filename: %s"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def usage(code, msg=''):
|
def usage(code, msg=''):
|
||||||
print __doc__ % globals()
|
print __doc__ % globals()
|
||||||
if msg:
|
if msg:
|
||||||
|
@ -153,7 +153,7 @@ def usage(code, msg=''):
|
||||||
sys.exit(code)
|
sys.exit(code)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def calculate_diff(entry, contextlines):
|
def calculate_diff(entry, contextlines):
|
||||||
file = entry.name
|
file = entry.name
|
||||||
oldrev = entry.revision
|
oldrev = entry.revision
|
||||||
|
@ -222,7 +222,7 @@ def calculate_diff(entry, contextlines):
|
||||||
return string.join(lines, '')
|
return string.join(lines, '')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rfc822_specials_re = re.compile(r'[\(\)\<\>\@\,\;\:\\\"\.\[\]]')
|
rfc822_specials_re = re.compile(r'[\(\)\<\>\@\,\;\:\\\"\.\[\]]')
|
||||||
|
|
||||||
def quotename(name):
|
def quotename(name):
|
||||||
|
@ -232,7 +232,7 @@ def quotename(name):
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def blast_mail(subject, people, entries, contextlines, fromhost, replyto, charset):
|
def blast_mail(subject, people, entries, contextlines, fromhost, replyto, charset):
|
||||||
# cannot wait for child process or that will cause parent to retain cvs
|
# cannot wait for child process or that will cause parent to retain cvs
|
||||||
# lock for too long. Urg!
|
# lock for too long. Urg!
|
||||||
|
@ -255,7 +255,7 @@ def blast_mail(subject, people, entries, contextlines, fromhost, replyto, charse
|
||||||
name = string.split(pwd.getpwnam(user)[4], ',')[0]
|
name = string.split(pwd.getpwnam(user)[4], ',')[0]
|
||||||
|
|
||||||
domain = fromhost or getfqdn()
|
domain = fromhost or getfqdn()
|
||||||
host = string.split(domain,'.')[0]
|
host = string.split(domain,'.')[0]
|
||||||
address = '%s@crans.org' % user
|
address = '%s@crans.org' % user
|
||||||
s = StringIO()
|
s = StringIO()
|
||||||
sys.stdout = s
|
sys.stdout = s
|
||||||
|
@ -266,7 +266,7 @@ def blast_mail(subject, people, entries, contextlines, fromhost, replyto, charse
|
||||||
'name' : quotename(name),
|
'name' : quotename(name),
|
||||||
'people' : string.join(people, COMMASPACE),
|
'people' : string.join(people, COMMASPACE),
|
||||||
'subject' : subject,
|
'subject' : subject,
|
||||||
'host' : host,
|
'host' : host,
|
||||||
'version' : __version__,
|
'version' : __version__,
|
||||||
'date' : datestamp,
|
'date' : datestamp,
|
||||||
}
|
}
|
||||||
|
@ -296,7 +296,7 @@ X-Mailer: Python syncmail %(version)s <http://sf.net/projects/cvs-syncmail>
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CVSEntry:
|
class CVSEntry:
|
||||||
def __init__(self, name, revision, timestamp, conflict, options, tagdate):
|
def __init__(self, name, revision, timestamp, conflict, options, tagdate):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
@ -398,13 +398,13 @@ def main():
|
||||||
# XXX Should really move all the options to an object, just to
|
# XXX Should really move all the options to an object, just to
|
||||||
# avoid threading so many positional args through everything.
|
# avoid threading so many positional args through everything.
|
||||||
if '- Imported sources NONE NONE' in sys.argv[1:] :
|
if '- Imported sources NONE NONE' in sys.argv[1:] :
|
||||||
# Cas d'un cvs import
|
# Cas d'un cvs import
|
||||||
print "Syncmail : import ignorés"
|
print "Syncmail : import ignorés"
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
if '- New directory NONE NONE' in sys.argv[1:] :
|
if '- New directory NONE NONE' in sys.argv[1:] :
|
||||||
# Cas de l'ajout d'un répertoir
|
# Cas de l'ajout d'un répertoir
|
||||||
print "Syncmail : ajout de répertoires ignorés"
|
print "Syncmail : ajout de répertoires ignorés"
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(
|
opts, args = getopt.getopt(
|
||||||
sys.argv[1:], 'hC:cuS:R:qf:m:',
|
sys.argv[1:], 'hC:cuS:R:qf:m:',
|
||||||
|
@ -419,7 +419,7 @@ def main():
|
||||||
verbose = 1
|
verbose = 1
|
||||||
subject_prefix = ""
|
subject_prefix = ""
|
||||||
replyto = None
|
replyto = None
|
||||||
charset = None
|
charset = 'iso-8859-15'
|
||||||
fromhost = None
|
fromhost = None
|
||||||
for opt, arg in opts:
|
for opt, arg in opts:
|
||||||
if opt in ('-h', '--help'):
|
if opt in ('-h', '--help'):
|
||||||
|
@ -480,7 +480,7 @@ def main():
|
||||||
print 'Generating notification message... done.'
|
print 'Generating notification message... done.'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue