summaryrefslogtreecommitdiff
path: root/docs/_ext
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-02 17:37:15 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-02 17:37:15 -0700
commitfe995e6cbdcf2766cf0aa951c8ef4549ad27694c (patch)
tree049678d37554ef07633ea714fe359952bf6cbdde /docs/_ext
parent393cdbfaa2d47c85f6764e80600de48f26f43327 (diff)
Fixed the remaining E302 violations int eh django package
Diffstat (limited to 'docs/_ext')
-rw-r--r--docs/_ext/applyxrefs.py4
-rw-r--r--docs/_ext/djangodocs.py2
-rw-r--r--docs/_ext/literals_to_xrefs.py1
3 files changed, 7 insertions, 0 deletions
diff --git a/docs/_ext/applyxrefs.py b/docs/_ext/applyxrefs.py
index cf5c3ac750..e9ba0fdd63 100644
--- a/docs/_ext/applyxrefs.py
+++ b/docs/_ext/applyxrefs.py
@@ -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
diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py
index 523c86df52..6a9659171d 100644
--- a/docs/_ext/djangodocs.py
+++ b/docs/_ext/djangodocs.py
@@ -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
diff --git a/docs/_ext/literals_to_xrefs.py b/docs/_ext/literals_to_xrefs.py
index 6c12ea43f3..268d084d42 100644
--- a/docs/_ext/literals_to_xrefs.py
+++ b/docs/_ext/literals_to_xrefs.py
@@ -37,6 +37,7 @@ ALWAYS_SKIP = [
"False",
]
+
def fixliterals(fname):
with open(fname) as fp:
data = fp.read()