From 92070bd6adf8997a3b3cbe53dc11e929acdf11f2 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Mon, 11 Jul 2011 13:06:06 -0700 Subject: Create a new code section on decorators --- pycco/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 === -- cgit v1.2.1