Skip to content

Commit

Permalink
Convert docstring to comment.
Browse files Browse the repository at this point in the history
When a docstring is in the middle of the code (instead of at the very top of
it), it doesn't have the effects of being part of the __doc__ property of
the object (function, class etc) and becomes a useless statement (i.e., a
noop).

Just convert that to a real comment.
  • Loading branch information
Rogério Brito committed Sep 5, 2012
1 parent 4af6f34 commit ec1a351
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions ikiwiki-wordpress-import.py
Expand Up @@ -64,17 +64,15 @@ def main(name, email, subdir, branch='master'):
content += "[[!meta date=\"%s\"]]\n" % datetime.fromtimestamp(timestamp)
content += x.find('content:encoded').string.replace('\r\n', '\n')

"""
We do it differently here because we have duplicates otherwise.
Take a look:
<category><![CDATA[Health]]></category>
<category domain="category" nicename="health"><![CDATA[Health]]></category>
If we do the what original did, we end up with all tags and cats doubled.
Therefore we only pick out nicename="foo". Our 'True' below is our 'foo'.
I'd much rather have the value of 'nicename', and tried, but my
python skillz are extremely limited....
"""
# We do it differently here because we have duplicates otherwise.
# Take a look:
# <category><![CDATA[Health]]></category>
# <category domain="category" nicename="health"><![CDATA[Health]]></category>
#
# If we do the what original did, we end up with all tags and cats doubled.
# Therefore we only pick out nicename="foo". Our 'True' below is our 'foo'.
# I'd much rather have the value of 'nicename', and tried, but my
# python skillz are extremely limited....
categories = x.findAll('category', nicename=True)
if categories:
content += "\n"
Expand Down

0 comments on commit ec1a351

Please sign in to comment.