mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Whitespace cleanup.
* Removed trailing whitespace. * Added newline to EOF if missing. * Removed blank lines at EOF. * Removed some stray tabs.
This commit is contained in:
parent
ca874b2fe6
commit
1dae4ac177
173 changed files with 602 additions and 678 deletions
|
@ -1,7 +1,7 @@
|
|||
The documentation in this tree is in plain text files and can be viewed using
|
||||
any text file viewer.
|
||||
|
||||
It uses ReST (reStructuredText) [1], and the Sphinx documentation system [2].
|
||||
It uses ReST (reStructuredText) [1], and the Sphinx documentation system [2].
|
||||
This allows it to be built into other forms for easier viewing and browsing.
|
||||
|
||||
To create an HTML version of the docs:
|
||||
|
|
|
@ -26,7 +26,7 @@ ROLES = (
|
|||
"term",
|
||||
"tfilter",
|
||||
"ttag",
|
||||
|
||||
|
||||
# special
|
||||
"skip"
|
||||
)
|
||||
|
@ -40,39 +40,39 @@ ALWAYS_SKIP = [
|
|||
def fixliterals(fname):
|
||||
with open(fname) as fp:
|
||||
data = fp.read()
|
||||
|
||||
|
||||
last = 0
|
||||
new = []
|
||||
storage = shelve.open("/tmp/literals_to_xref.shelve")
|
||||
lastvalues = storage.get("lastvalues", {})
|
||||
|
||||
|
||||
for m in refre.finditer(data):
|
||||
|
||||
|
||||
new.append(data[last:m.start()])
|
||||
last = m.end()
|
||||
|
||||
|
||||
line_start = data.rfind("\n", 0, m.start())
|
||||
line_end = data.find("\n", m.end())
|
||||
prev_start = data.rfind("\n", 0, line_start)
|
||||
next_end = data.find("\n", line_end + 1)
|
||||
|
||||
|
||||
# Skip always-skip stuff
|
||||
if m.group(1) in ALWAYS_SKIP:
|
||||
new.append(m.group(0))
|
||||
continue
|
||||
|
||||
|
||||
# skip when the next line is a title
|
||||
next_line = data[m.end():next_end].strip()
|
||||
if next_line[0] in "!-/:-@[-`{-~" and all(c == next_line[0] for c in next_line):
|
||||
new.append(m.group(0))
|
||||
continue
|
||||
|
||||
|
||||
sys.stdout.write("\n"+"-"*80+"\n")
|
||||
sys.stdout.write(data[prev_start+1:m.start()])
|
||||
sys.stdout.write(colorize(m.group(0), fg="red"))
|
||||
sys.stdout.write(data[m.end():next_end])
|
||||
sys.stdout.write("\n\n")
|
||||
|
||||
|
||||
replace_type = None
|
||||
while replace_type is None:
|
||||
replace_type = raw_input(
|
||||
|
@ -80,34 +80,34 @@ def fixliterals(fname):
|
|||
).strip().lower()
|
||||
if replace_type and replace_type not in ROLES:
|
||||
replace_type = None
|
||||
|
||||
|
||||
if replace_type == "":
|
||||
new.append(m.group(0))
|
||||
continue
|
||||
|
||||
|
||||
if replace_type == "skip":
|
||||
new.append(m.group(0))
|
||||
ALWAYS_SKIP.append(m.group(1))
|
||||
continue
|
||||
|
||||
|
||||
default = lastvalues.get(m.group(1), m.group(1))
|
||||
if default.endswith("()") and replace_type in ("class", "func", "meth"):
|
||||
default = default[:-2]
|
||||
default = default[:-2]
|
||||
replace_value = raw_input(
|
||||
colorize("Text <target> [", fg="yellow") + default + colorize("]: ", fg="yellow")
|
||||
).strip()
|
||||
if not replace_value:
|
||||
if not replace_value:
|
||||
replace_value = default
|
||||
new.append(":%s:`%s`" % (replace_type, replace_value))
|
||||
lastvalues[m.group(1)] = replace_value
|
||||
|
||||
|
||||
new.append(data[last:])
|
||||
with open(fname, "w") as fp:
|
||||
fp.write("".join(new))
|
||||
|
||||
|
||||
storage["lastvalues"] = lastvalues
|
||||
storage.close()
|
||||
|
||||
|
||||
#
|
||||
# The following is taken from django.utils.termcolors and is copied here to
|
||||
# avoid the dependency.
|
||||
|
|
16
docs/_theme/djangodocs/layout.html
vendored
16
docs/_theme/djangodocs/layout.html
vendored
|
@ -2,13 +2,13 @@
|
|||
|
||||
{%- macro secondnav() %}
|
||||
{%- if prev %}
|
||||
« <a href="{{ prev.link|e }}" title="{{ prev.title|e }}">previous</a>
|
||||
« <a href="{{ prev.link|e }}" title="{{ prev.title|e }}">previous</a>
|
||||
{{ reldelim2 }}
|
||||
{%- endif %}
|
||||
{%- if parents %}
|
||||
<a href="{{ parents.0.link|e }}" title="{{ parents.0.title|e }}" accesskey="U">up</a>
|
||||
<a href="{{ parents.0.link|e }}" title="{{ parents.0.title|e }}" accesskey="U">up</a>
|
||||
{%- else %}
|
||||
<a title="{{ docstitle }}" href="{{ pathto('index') }}" accesskey="U">up</a>
|
||||
<a title="{{ docstitle }}" href="{{ pathto('index') }}" accesskey="U">up</a>
|
||||
{%- endif %}
|
||||
{%- if next %}
|
||||
{{ reldelim2 }}
|
||||
|
@ -65,13 +65,13 @@
|
|||
</div>
|
||||
<div class="nav">{{ secondnav() }}</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="bd">
|
||||
<div id="yui-main">
|
||||
<div class="yui-b">
|
||||
<div class="yui-g" id="{{ pagename|replace('/', '-') }}">
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block sidebarwrapper %}
|
||||
|
@ -82,11 +82,11 @@
|
|||
<h3>Last update:</h3>
|
||||
<p class="topless">{{ last_updated }}</p>
|
||||
{%- endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
|
||||
<div id="ft">
|
||||
<div class="nav">{{ secondnav() }}</div>
|
||||
</div>
|
||||
|
@ -113,7 +113,7 @@
|
|||
<ul><li>{{ title }}</li></ul>
|
||||
{% for p in parents %}</li></ul>{% endfor %}
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{# Empty some default blocks out #}
|
||||
|
|
|
@ -4,7 +4,7 @@ Django FAQ
|
|||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
|
||||
general
|
||||
install
|
||||
usage
|
||||
|
|
|
@ -175,7 +175,7 @@ This means the ticket has an associated
|
|||
:doc:`patch<writing-code/submitting-patches>`. These will be reviewed
|
||||
to see if the patch is "good".
|
||||
|
||||
The following three fields (Needs documentation, Needs tests,
|
||||
The following three fields (Needs documentation, Needs tests,
|
||||
Patch needs improvement) apply only if a patch has been supplied.
|
||||
|
||||
Needs documentation
|
||||
|
|
|
@ -67,7 +67,7 @@ as possible.
|
|||
The `discussion of DRY on the Portland Pattern Repository`__
|
||||
|
||||
__ http://c2.com/cgi/wiki?DontRepeatYourself
|
||||
|
||||
|
||||
.. _explicit-is-better-than-implicit:
|
||||
|
||||
Explicit is better than implicit
|
||||
|
|
|
@ -6,7 +6,7 @@ your kitchen with the scissors, batteries, duct tape, and other junk.
|
|||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
|
||||
api-stability
|
||||
design-philosophies
|
||||
distributions
|
||||
|
|
|
@ -9,7 +9,7 @@ GeoDjango Forms API
|
|||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
GeoDjango provides some specialized form fields and widgets in order to visually
|
||||
GeoDjango provides some specialized form fields and widgets in order to visually
|
||||
display and edit geolocalized data on a map. By default, they use
|
||||
`OpenLayers`_-powered maps, with a base WMS layer provided by `Metacarta`_.
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ A related object set can be replaced in bulk with one operation by assigning a
|
|||
new iterable of objects to it::
|
||||
|
||||
>>> new_list = [obj1, obj2, obj3]
|
||||
>>> e.related_set = new_list
|
||||
>>> e.related_set = new_list
|
||||
|
||||
If the foreign key relationship has ``null=True``, then the related manager
|
||||
will first call ``clear()`` to disassociate any existing objects in the related
|
||||
|
|
|
@ -56,7 +56,7 @@ Split ``CacheMiddleware``
|
|||
into and reading from the cache) separately, offering additional
|
||||
flexibility for situations where combining these functions into a
|
||||
single middleware posed problems. Full details, including updated
|
||||
notes on appropriate use, are in
|
||||
notes on appropriate use, are in
|
||||
:doc:`the caching documentation </topics/cache>`.
|
||||
|
||||
Removal of deprecated features
|
||||
|
|
|
@ -100,7 +100,7 @@ interested in helping out with Django's development, feel free to join the
|
|||
discussions there.
|
||||
|
||||
Django's online documentation also includes pointers on how to contribute to
|
||||
Django:
|
||||
Django:
|
||||
|
||||
* :doc:`How to contribute to Django </internals/contributing/index>`
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ interested in helping out with Django's development, feel free to join the
|
|||
discussions there.
|
||||
|
||||
Django's online documentation also includes pointers on how to contribute to
|
||||
Django:
|
||||
Django:
|
||||
|
||||
* :doc:`How to contribute to Django </internals/contributing/index>`
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ Django 1.2.7 release notes
|
|||
Welcome to Django 1.2.7!
|
||||
|
||||
This is the seventh bugfix/security release in the Django 1.2 series. It
|
||||
replaces Django 1.2.6 due to problems with the 1.2.6 release tarball.
|
||||
replaces Django 1.2.6 due to problems with the 1.2.6 release tarball.
|
||||
Django 1.2.7 is a recommended upgrade for all users of any Django release in
|
||||
the 1.2.X series.
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ Information on handling HTTP requests in Django:
|
|||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
|
||||
urls
|
||||
views
|
||||
decorators
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue