Commits

Andy Mikhailenko committed a9d03fa

Allow multi-line descriptions in `load-from-file`

  • Participants
  • Parent commits e8ea1d1

Comments (0)

Files changed (1)

File timetra/cli/__init__.py

 
     def _parse_record(raw, date):
         date = datetime.datetime.combine(date, datetime.time(23,59))
-        pattern = re.compile(r'(?P<since>\d{4})\-(?P<until>\d{4}) '
+        pattern = re.compile(r'(?P<since>\d{4})\-(?P<until>\d{4})\s'
                              r'(?P<activity>[a-z\-_@]+)'
-                             r'(?P<description> .+)?$')
+                             r'(?P<description>\s+.+)?')
         match = pattern.search(raw)
         if not match:
             raise ValueError(u'could not parse "{0}"'.format(raw))