Fixed the remaining E302 violations int eh django package

This commit is contained in:
Alex Gaynor 2013-11-02 17:37:15 -07:00
parent 393cdbfaa2
commit fe995e6cbd
19 changed files with 199 additions and 0 deletions

View file

@ -9,11 +9,13 @@ DONT_TOUCH = (
'./index.txt',
)
def target_name(fn):
if fn.endswith('.txt'):
fn = fn[:-4]
return '_' + fn.lstrip('./').replace('/', '-')
def process_file(fn, lines):
lines.insert(0, '\n')
lines.insert(0, '.. %s:\n' % target_name(fn))
@ -23,6 +25,7 @@ def process_file(fn, lines):
except IOError:
print("Can't open %s for writing. Not touching it." % fn)
def has_target(fn):
try:
with open(fn, 'r') as fp:
@ -39,6 +42,7 @@ def has_target(fn):
return (True, None)
return (False, lines)
def main(argv=None):
if argv is None:
argv = sys.argv