+ m = re.match(self.META_REGEX, self.text)
+ if m:
+ for line in m.group(1).split('\n'):
+ try:
+ k, v = line.split(':', 1)
+ result[k.strip()] = v.strip()
+ except ValueError:
+ continue
+
+ return result
+
+# Every time somebody says "let's have a global variable", God kills a kitten.
+storage = DocumentStorage(settings.REPOSITORY_PATH)