summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Maltese <mike@mikemaltese.com>2011-07-11 13:06:06 -0700
committerMichael Maltese <mike@mikemaltese.com>2011-07-11 13:06:06 -0700
commit92070bd6adf8997a3b3cbe53dc11e929acdf11f2 (patch)
treea34aa19ef0e316bd29a06526d7247970be0f2f77
parent519825ecefcb9a32038770ca13393a2a039e901f (diff)
downloadpycco-92070bd6adf8997a3b3cbe53dc11e929acdf11f2.tar.gz
Create a new code section on decorators
-rw-r--r--pycco/main.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pycco/main.py b/pycco/main.py
index 0a06b86..fd91c65 100644
--- a/pycco/main.py
+++ b/pycco/main.py
@@ -130,7 +130,7 @@ def parse(source, code):
docs_text += re.sub(language["comment_matcher"], "", line) + "\n"
else:
- if code_text and any([line.lstrip().startswith(x) for x in ['class ', 'def ']]):
+ if code_text and any([line.lstrip().startswith(x) for x in ['class ', 'def ', '@']]):
if not code_text.lstrip().startswith("@"):
save(docs_text, code_text)
code_text = has_code = docs_text = ''
@@ -140,6 +140,7 @@ def parse(source, code):
save(docs_text, code_text)
+
return sections
# === Preprocessing the comments ===