diff options
author | Florent Pigout <florent.pigout@gmail.com> | 2011-10-25 03:18:32 (GMT) |
---|---|---|
committer | Florent Pigout <florent.pigout@gmail.com> | 2011-10-25 03:18:32 (GMT) |
commit | 527e345366268327f9d1157324a06d888f42c4d5 (patch) | |
tree | 5181f286b0668362e39455f3508daf5c54538664 | |
parent | e868e5da6146dbd1797dfe48538fd61bf524dba4 (diff) |
ensure good resource init for real target
-rw-r--r-- | atoidejouer/tools/storage.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/atoidejouer/tools/storage.py b/atoidejouer/tools/storage.py index 9552130..59e1e79 100644 --- a/atoidejouer/tools/storage.py +++ b/atoidejouer/tools/storage.py @@ -402,12 +402,15 @@ def add_file_to_journal(file_name, file_path, mime_type): def __check_file_in_journal(sub_path, file_name, mime_type=None): + # dummy + if file_name in ['blank']: + return # is already in the journal - if is_in_journal(file_name, mime_type): + elif is_in_journal(file_name, mime_type): pass else: # file path - _path = os.path.join(ROOT, 'data', sub_path, file_name) + _path = os.path.join(BUND, 'static', 'ext', sub_path, file_name) # ensure dir exist in bundle add_file_to_journal(file_name, _path, mime_type) @@ -417,12 +420,7 @@ def __check_dir_files(sub_path, mime_type=None, in_journal=False): _path = os.path.join(BUND, 'static', 'ext', sub_path) # file by file for _f in os.listdir(_path): - # full path - _p = os.path.join(_path, _f) - # little check - if os.path.isdir(_p) or _f in ['blank']: - pass - elif in_journal is True: + if in_journal is True: __check_file_in_journal(sub_path, _f, mime_type=mime_type) else: __check_file_in_bundle(sub_path, _f) |