From 346d37211f830e1a117160d981e322efaaab0fd6 Mon Sep 17 00:00:00 2001 From: Pradyumna Date: Sun, 4 Sep 2022 14:10:33 +0530 Subject: [PATCH 1/2] 1. added entries to exclude entire pycache folder. For each version of python, the earlier gitignore would not work 2. Added gitignore entry for virtualenv folder 3. Added requiremnents file for easy install through pip --- .gitignore | 3 ++- requirements.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore index e18684b..21d9a0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ -__pycache__/N2Omodule.cpython-38.pyc +__pycache__ N2O-TS1.py +venv diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9880710 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +easygui==0.98.3 From 7180861f7c2b0dfe3d4238d27284cc0eb32e5753 Mon Sep 17 00:00:00 2001 From: Pradyumna Date: Sun, 4 Sep 2022 14:11:29 +0530 Subject: [PATCH 2/2] Added an exception for a cse when fileNot Found error was being triggerred Issue is due to long windows path --- N2O.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/N2O.py b/N2O.py index 9f472d5..6e09fd0 100644 --- a/N2O.py +++ b/N2O.py @@ -104,6 +104,7 @@ def debug_print(msg): num_link = [0, 0, 0, 0] +error_filepath = [] # Process all MD files for n in mdIndex: @@ -128,9 +129,13 @@ def debug_print(msg): else: append_write = 'w' # make a new file if not - # Save modified content as new .md file - with open(newfilepath, append_write, encoding='utf-8') as tempFile: - [print(line.rstrip(), file=tempFile) for line in mdContent] + try: + # Save modified content as new .md file + with open(newfilepath, append_write, encoding='utf-8') as tempFile: + [print(line.rstrip(), file=tempFile) for line in mdContent] + except FileNotFoundError: + print(f"::OnSave:: Possible long file path for windows? {newfilepath}\n") + error_filepath.append(newfilepath) @@ -156,6 +161,10 @@ def debug_print(msg): print(' !!File Exception!!',ObsidianPaths[n]) print(NotionPathRaw[n], file=e) print('', file=e) + + + + print(f"\nTotal converted links:") @@ -163,6 +172,7 @@ def debug_print(msg): print(f" - Embedded links: {num_link[1]}") print(f" - Blank links : {num_link[2]}") print(f" - Number tags : {num_link[3]}") +print(f" - FileException : {len(error_filepath)}") # Save temporary file collection to new zip