From 531232f7a4bec1e9b65369a465f37638735a833c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kn=C3=BCttel?= Date: Wed, 10 Oct 2018 09:53:36 +0200 Subject: [PATCH] added relative paths for already saved .licor.lists --- licor/main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/licor/main.py b/licor/main.py index 21c23d0..2827e15 100644 --- a/licor/main.py +++ b/licor/main.py @@ -58,10 +58,13 @@ Options: db_filename = ".licor.list" -def get_ignored(path): +def get_ignored(path, root_path = ""): + if(not root_path): + root_path = os.curdir try: 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: return [] @@ -96,7 +99,10 @@ def list_this_path(path, file_ending, ignore_db = False): ignore_files = get_ignored(path) else: 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): if(not ignore_db):