mirror of
https://github.com/daknuett/licor
synced 2024-07-20 12:15:24 +00:00
added relative paths for already saved .licor.lists
This commit is contained in:
parent
29f806411e
commit
531232f7a4
|
@ -58,10 +58,13 @@ Options:
|
||||||
|
|
||||||
|
|
||||||
db_filename = ".licor.list"
|
db_filename = ".licor.list"
|
||||||
def get_ignored(path):
|
def get_ignored(path, root_path = ""):
|
||||||
|
if(not root_path):
|
||||||
|
root_path = os.curdir
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(path, db_filename)) as f:
|
with open(os.path.join(path, db_filename)) as f:
|
||||||
return f.read().split("\n")
|
return [os.path.relpath(os.path.abspath(p), root_path)
|
||||||
|
for p in f.read().split("\n")]
|
||||||
except:
|
except:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@ -96,7 +99,10 @@ def list_this_path(path, file_ending, ignore_db = False):
|
||||||
ignore_files = get_ignored(path)
|
ignore_files = get_ignored(path)
|
||||||
else:
|
else:
|
||||||
ignore_files = []
|
ignore_files = []
|
||||||
work_this_path(path, file_ending, [print], ignore_files = ignore_files)
|
work_this_path(path
|
||||||
|
, file_ending
|
||||||
|
, [print]
|
||||||
|
, ignore_files = ignore_files)
|
||||||
|
|
||||||
def list_all(path, file_ending, ignore_paths, ignore_db = False):
|
def list_all(path, file_ending, ignore_paths, ignore_db = False):
|
||||||
if(not ignore_db):
|
if(not ignore_db):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user