Commits

Gabriele Lanaro committed 6c6caf1

parse propertes passes the tests

  • Participants
  • Parent commits 9067490

Comments (0)

Files changed (1)

File pyorg/parser.py

     else:
         return []
 
+def parse_properties(props):
+    """parse the contents of the properties section into a dictionary
+    """
+    regex = re.compile("^\s*:(\w+):\s*(.*?)\s*$",re.MULTILINE)
+    return dict(regex.findall(props))
+
+
 class Node(object):
     """represent a typical headline+text in an orgnode file
     """
     def __init__(self, text):
         self.text = text
         self.headline = text.splitlines()[0]
+        
         self.level = maxhead(text)
         self.tags = parse_tags(self.headline)