mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-05 21:29:11 +00:00
Allow reuse of get_absolute_path, is_none_or_empty methods
- Move them to utils.helper.py for reuse - Import those modules where required - Delete duplicate methods defined in org_to_jsonl.py, asymmetric.py
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
# Import Modules
|
||||
import processor.org_mode.orgnode
|
||||
from utils.helpers import get_absolute_path, is_none_or_empty
|
||||
import json
|
||||
import argparse
|
||||
import pathlib
|
||||
@@ -119,14 +120,6 @@ def convert_org_entries_to_jsonl(entries, verbose=0):
|
||||
return jsonl
|
||||
|
||||
|
||||
def is_none_or_empty(item):
|
||||
return item == None or (hasattr(item, '__iter__') and len(item) == 0)
|
||||
|
||||
|
||||
def get_absolute_path(filepath):
|
||||
return str(pathlib.Path(filepath).expanduser().absolute())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Setup Argument Parser
|
||||
parser = argparse.ArgumentParser(description="Map Org-Mode notes into (compressed) JSONL format")
|
||||
|
||||
Reference in New Issue
Block a user