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/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 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