Skip to content

Commit

Permalink
Merge pull request #60 from Pseudonium/develop
Browse files Browse the repository at this point in the history
Files processed in natural order
  • Loading branch information
Pseudonium authored Sep 21, 2020
2 parents e22ded3 + 5fed678 commit c5abb1a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
18 changes: 11 additions & 7 deletions obsidian_to_anki.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,13 +1384,17 @@ def __init__(self, abspath, regex=False, onefile=None):
self.files = [self.file_class(onefile)]
else:
with os.scandir() as it:
self.files = [
self.file_class(entry.path)
for entry in it
if entry.is_file() and os.path.splitext(
entry.path
)[1] in App.SUPPORTED_EXTS
]
self.files = sorted(
[
self.file_class(entry.path)
for entry in it
if entry.is_file() and os.path.splitext(
entry.path
)[1] in App.SUPPORTED_EXTS
], key=lambda file: [
int(part) if part.isdigit() else part.lower()
for part in re.split(r'(\d+)', file.filename)]
)
for file in self.files:
file.scan_file()
os.chdir(self.parent)
Expand Down
15 changes: 8 additions & 7 deletions obsidian_to_anki_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ CurlyCloze = False
GUI = True
Regex = False
ID Comments = True
Anki Path =
Anki Profile =
Anki Path =
Anki Profile =

[Custom Regexps]
Basic =
Basic (and reversed card) =
Basic (optional reversed card) =
Basic (type in the answer) =
Cloze =
Basic =
Basic (and reversed card) =
Basic (optional reversed card) =
Basic (type in the answer) =
Cloze =

[Added Media]

0 comments on commit c5abb1a

Please sign in to comment.