diff options
Diffstat (limited to 'kronos/parser.py')
-rw-r--r-- | kronos/parser.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kronos/parser.py b/kronos/parser.py index 8d93391..f0543f9 100644 --- a/kronos/parser.py +++ b/kronos/parser.py | |||
@@ -24,8 +24,8 @@ def parse_activity(text): | |||
24 | description = description.strip() | 24 | description = description.strip() |
25 | 25 | ||
26 | tokens = description.split(' ') | 26 | tokens = description.split(' ') |
27 | tags = parse_tags(tokens) | 27 | tags = _parse_tags(tokens) |
28 | description = strip_tags(tokens) | 28 | description = _strip_tags(tokens) |
29 | 29 | ||
30 | category = None | 30 | category = None |
31 | if '@' in text: | 31 | if '@' in text: |
@@ -38,9 +38,10 @@ def parse_activity(text): | |||
38 | return activity | 38 | return activity |
39 | 39 | ||
40 | 40 | ||
41 | def parse_tags(tokens): | 41 | def _parse_tags(tokens): |
42 | return [token.lstrip('#') for token in tokens if token.startswith('#')] | 42 | return [token.lstrip('#') for token in tokens if token.startswith('#')] |
43 | 43 | ||
44 | 44 | ||
45 | def strip_tags(tokens): | 45 | def _strip_tags(tokens): |
46 | return ' '.join([token for token in tokens if not token.startswith('#')]) | 46 | words = [token for token in tokens if not token.startswith('#')] |
47 | return ' '.join(words) | ||