Sur une bonne idée de nico
Idé pour la suite : tester l'extention (pdf, png... = binaire) pour les jours ou momo modifiera le site install party et qu'on va avoir les diff des png. darcs-hash:20060523134507-4ec08-0f55b09aefd2527e127888a1b58a582e54cb040c.gz
This commit is contained in:
parent
ef72c4badf
commit
455f077b6a
1 changed files with 7 additions and 7 deletions
14
syncmail
14
syncmail
|
@ -187,13 +187,13 @@ def calculate_diff(entry, contextlines):
|
||||||
fp.close()
|
fp.close()
|
||||||
# Is this a binary file? Let's look at the first few
|
# Is this a binary file? Let's look at the first few
|
||||||
# lines to figure it out:
|
# lines to figure it out:
|
||||||
for line in lines[:5]:
|
#for line in lines[:5]:
|
||||||
for c in string.rstrip(line):
|
# for c in string.rstrip(line):
|
||||||
if c in string.whitespace:
|
# if c in string.whitespace:
|
||||||
continue
|
# continue
|
||||||
if c < ' ' or c > chr(127):
|
# if c < ' ' or c > chr(127):
|
||||||
lines = BINARY_EXPLANATION_LINES[:]
|
# lines = BINARY_EXPLANATION_LINES[:]
|
||||||
break
|
# break
|
||||||
lines.insert(0, '--- NEW FILE: %s ---\n' % file)
|
lines.insert(0, '--- NEW FILE: %s ---\n' % file)
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
lines = ['***** Error reading new file: ',
|
lines = ['***** Error reading new file: ',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue