mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 00:28:22 +00:00
fix: [gitignore]
This commit is contained in:
parent
d941d8abb4
commit
056b6006f6
2 changed files with 38 additions and 0 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -19,6 +19,9 @@ DATA_ARDB
|
|||
indexdir/
|
||||
logs/
|
||||
old/
|
||||
pgpdump/
|
||||
temp/
|
||||
|
||||
|
||||
DEFAULT_PASSWORD
|
||||
|
||||
|
|
|
@ -166,3 +166,38 @@ def add_map_obj_id_item_id(obj_id, item_id, obj_type):
|
|||
# delete twitter id
|
||||
|
||||
##-- --##
|
||||
|
||||
## COMMON ##
|
||||
def _get_dir_source_name(directory, source_name=None, l_sources_name=set()):
|
||||
if source_name:
|
||||
l_dir = os.listdir(os.path.join(directory, source_name))
|
||||
else:
|
||||
l_dir = os.listdir(directory)
|
||||
# empty directory
|
||||
if not l_dir:
|
||||
return l_sources_name.add(source_name)
|
||||
return l_sources_name
|
||||
else:
|
||||
for src_name in l_dir:
|
||||
if len(src_name) == 4:
|
||||
try:
|
||||
int(src_name)
|
||||
l_sources_name.add(os.path.join(source_name))
|
||||
return l_sources_name
|
||||
except:
|
||||
pass
|
||||
if source_name:
|
||||
src_name = os.path.join(source_name, src_name)
|
||||
l_sources_name = _get_dir_source_name(directory, source_name=src_name, l_sources_name=l_sources_name)
|
||||
return l_sources_name
|
||||
|
||||
|
||||
def get_all_items_sources():
|
||||
res = _get_dir_source_name(PASTES_FOLDER)
|
||||
print(res)
|
||||
|
||||
##-- --##
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
get_all_items_sources()
|
||||
|
|
Loading…
Reference in a new issue