fnp
/
edumed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
most of stage 2
[edumed.git]
/
catalogue
/
management
/
commands
/
importlessons.py
diff --git
a/catalogue/management/commands/importlessons.py
b/catalogue/management/commands/importlessons.py
index
d179b16
..
d4733d3
100755
(executable)
--- a/
catalogue/management/commands/importlessons.py
+++ b/
catalogue/management/commands/importlessons.py
@@
-33,6
+33,8
@@
class Command(BaseCommand):
@staticmethod
def all_attachments(path):
files = {}
@staticmethod
def all_attachments(path):
files = {}
+ if not os.path.isdir(path):
+ return files
def read_dir(path):
for name in os.listdir(path):
def read_dir(path):
for name in os.listdir(path):
@@
-94,6
+96,12
@@
class Command(BaseCommand):
file_path = os.path.join(abs_dir, file_name)
file_base, ext = os.path.splitext(file_path)
file_path = os.path.join(abs_dir, file_name)
file_base, ext = os.path.splitext(file_path)
+ if os.path.isdir(file_path):
+ dir_imported, dir_skipped = self.import_from_dir(file_path)
+ files_imported += dir_imported
+ files_skipped += files_skipped
+ continue
+
# Skip files that are not XML files
if not ext == '.xml':
continue
# Skip files that are not XML files
if not ext == '.xml':
continue