mirror of
https://github.com/django/django.git
synced 2025-07-20 11:45:10 +00:00
Fixed the remaining E302 violations int eh django package
This commit is contained in:
parent
393cdbfaa2
commit
fe995e6cbd
19 changed files with 199 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue