medit/checkle.py

23 lines
562 B
Python
Raw Normal View History

2008-01-17 07:36:04 -06:00
#!/usr/bin/env python
import os
import sys
import subprocess
2008-08-29 04:39:42 -05:00
files = subprocess.Popen(['hg', 'log', '-r', 'tip', '--template', '{files}'],
2008-01-17 07:36:04 -06:00
stdout=subprocess.PIPE).communicate()[0].split()
status = 0
for name in files:
2008-09-15 03:59:22 -05:00
if not os.path.exists(name) or name.startswith('medit/data') or \
name.endswith('.icns') or name.endswith('.png'):
continue
2008-01-17 07:36:04 -06:00
f = open(name, 'rb')
if '\r' in f.read():
print >> sys.stderr, "%s contains \\r character" % (name,)
status = 1
f.close()
sys.exit(status)