summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJonathan Ellis <jbellis@gmail.com>2007-08-03 13:57:40 +0000
committerJonathan Ellis <jbellis@gmail.com>2007-08-03 13:57:40 +0000
commitd7575a738d420a564e7a22f3347ab8f4442110bb (patch)
tree6c830566e7af1aa47c91ff745503532a03f7a8cd /doc
parent42812c06c182b236f491cb33315527a54fcba002 (diff)
downloadsqlalchemy-d7575a738d420a564e7a22f3347ab8f4442110bb.tar.gz
switch (simple) occurences of 'if len(x)' to 'if x': find . -name '*.py' |xargs perl -pi.bak -e 's/if len\((\S+)\):/if $1:/' && find . -name '*.bak' |xargs rm
Diffstat (limited to 'doc')
-rw-r--r--doc/build/lib/highlight.py4
-rw-r--r--doc/build/lib/toc.py2
-rw-r--r--doc/build/read_markdown.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/doc/build/lib/highlight.py b/doc/build/lib/highlight.py
index 1a838408b..2fff3704e 100644
--- a/doc/build/lib/highlight.py
+++ b/doc/build/lib/highlight.py
@@ -170,7 +170,7 @@ class PythonHighlighter(Highlighter):
curc = t[2][1]
if self.get_style(t[0], t[1]) != curstyle:
- if len(tokens):
+ if tokens:
self.colorize([(string.join(tokens, ''), curstyle)])
tokens = []
curstyle = self.get_style(t[0], t[1])
@@ -187,7 +187,7 @@ class PythonHighlighter(Highlighter):
curl = t[3][0]
# any remaining content to output, output it
- if len(tokens):
+ if tokens:
self.colorize([(string.join(tokens, ''), curstyle)])
if trailingspace:
diff --git a/doc/build/lib/toc.py b/doc/build/lib/toc.py
index dcad5d5c6..b62951345 100644
--- a/doc/build/lib/toc.py
+++ b/doc/build/lib/toc.py
@@ -44,7 +44,7 @@ class TOCElement(object):
self.next = None
self.children = []
if parent:
- if len(parent.children):
+ if parent.children:
self.previous = parent.children[-1]
parent.children[-1].next = self
parent.children.append(self)
diff --git a/doc/build/read_markdown.py b/doc/build/read_markdown.py
index 858283bde..aad2502d7 100644
--- a/doc/build/read_markdown.py
+++ b/doc/build/read_markdown.py
@@ -25,7 +25,7 @@ def dump_tree(elem, stream):
dump_mako_tag(elem, stream)
else:
if elem.tag != 'html':
- if len(elem.attrib):
+ if elem.attrib:
stream.write("<%s %s>" % (elem.tag, " ".join(["%s=%s" % (key, repr(val)) for key, val in elem.attrib.iteritems()])))
else:
stream.write("<%s>" % elem.tag)