mirror of
https://github.com/django/django.git
synced 2025-10-17 22:07:29 +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
|
||||
|
|
|
@ -293,6 +293,7 @@ class DjangoHTMLTranslator(SmartyPantsHTMLTranslator):
|
|||
SmartyPantsHTMLTranslator.visit_section(self, node)
|
||||
node['ids'] = old_ids
|
||||
|
||||
|
||||
def parse_django_admin_node(env, sig, signode):
|
||||
command = sig.split(' ')[0]
|
||||
env._django_curr_admin_command = command
|
||||
|
@ -300,6 +301,7 @@ def parse_django_admin_node(env, sig, signode):
|
|||
signode += addnodes.desc_name(title, title)
|
||||
return sig
|
||||
|
||||
|
||||
def parse_django_adminopt_node(env, sig, signode):
|
||||
"""A copy of sphinx.directives.CmdoptionDesc.parse_signature()"""
|
||||
from sphinx.domains.std import option_desc_re
|
||||
|
|
|
@ -37,6 +37,7 @@ ALWAYS_SKIP = [
|
|||
"False",
|
||||
]
|
||||
|
||||
|
||||
def fixliterals(fname):
|
||||
with open(fname) as fp:
|
||||
data = fp.read()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue