Commit 455f077b authored by chove's avatar chove

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
parent ef72c4ba
......@@ -187,13 +187,13 @@ def calculate_diff(entry, contextlines):
fp.close()
# Is this a binary file? Let's look at the first few
# lines to figure it out:
for line in lines[:5]:
for c in string.rstrip(line):
if c in string.whitespace:
continue
if c < ' ' or c > chr(127):
lines = BINARY_EXPLANATION_LINES[:]
break
#for line in lines[:5]:
# for c in string.rstrip(line):
# if c in string.whitespace:
# continue
# if c < ' ' or c > chr(127):
# lines = BINARY_EXPLANATION_LINES[:]
# break
lines.insert(0, '--- NEW FILE: %s ---\n' % file)
except IOError, e:
lines = ['***** Error reading new file: ',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment