Explorar o código

org_reader: register the reader

Gendre Sébastien %!s(int64=7) %!d(string=hai) anos
pai
achega
cf8795eaf9
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      org_reader/org_reader.py

+ 6 - 0
org_reader/org_reader.py

@@ -82,3 +82,9 @@ class OrgReader(BaseReader):
         content_html = org_to_html("\n".join(content))
         return content_html, metadatas
     
+def add_reader(readers):
+    for ext in OrgReader.file_extensions:
+        readers.reader_classes[ext] = OrgReader
+
+def register():
+    signals.readers_init.connect(add_reader)