diff options
| -rw-r--r-- | note_tools/commands.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/note_tools/commands.py b/note_tools/commands.py index 610d9be..5d150a1 100644 --- a/note_tools/commands.py +++ b/note_tools/commands.py | |||
| @@ -2,7 +2,6 @@ import sublime | |||
| 2 | import sublime_plugin | 2 | import sublime_plugin |
| 3 | import datetime | 3 | import datetime |
| 4 | import os | 4 | import os |
| 5 | import sys | ||
| 6 | from pathlib import Path | 5 | from pathlib import Path |
| 7 | from typing import List, Optional, Tuple | 6 | from typing import List, Optional, Tuple |
| 8 | 7 | ||
| @@ -28,8 +27,6 @@ class NewNoteCommand(sublime_plugin.WindowCommand): | |||
| 28 | break | 27 | break |
| 29 | 28 | ||
| 30 | if notes_path: | 29 | if notes_path: |
| 31 | year, month, day = date_str_display.split('-') | ||
| 32 | file_path = os.path.join(notes_path, year, month, file_name) | ||
| 33 | 30 | ||
| 34 | # Check if file already exists | 31 | # Check if file already exists |
| 35 | if os.path.exists(file_path): | 32 | if os.path.exists(file_path): |
| @@ -57,13 +54,3 @@ class NewNoteCommand(sublime_plugin.WindowCommand): | |||
| 57 | sublime.set_timeout_async(lambda: self.set_cursor_position(view), 100) | 54 | sublime.set_timeout_async(lambda: self.set_cursor_position(view), 100) |
| 58 | else: | 55 | else: |
| 59 | on_load() | 56 | on_load() |
| 60 | |||
| 61 | def list_files(self, directory: str, ignore_extensions: Optional[List[str]] = None) -> List[Path]: | ||
| 62 | if ignore_extensions is None: | ||
| 63 | ignore_extensions = [] | ||
| 64 | return [file for file in Path(directory).glob("*") if file.is_file() and file.suffix not in ignore_extensions] | ||
| 65 | |||
| 66 | def parse_file_date (self, file_name: str) -> Tuple[str, str]: | ||
| 67 | year = file_name[:4] | ||
| 68 | month = file_name[4:6] | ||
| 69 | return year, month | ||
