1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-06 23:35:38 +00:00

diff static

This commit is contained in:
deadc0de6
2024-01-27 09:10:30 +01:00
committed by deadc0de
parent f54788b0e7
commit e94b5bb5c0
3 changed files with 41 additions and 17 deletions

View File

@@ -13,10 +13,11 @@ from dotdrop.utils import must_ignore
class FTreeDir:
"""directory tree for comparison"""
def __init__(self, path, ignores=None, debug=False):
self.path = path
self.ignores
self.ignores = ignores
self.debug = debug
self.entries = []
if os.path.exists(path) and os.path.isdir(path):
@@ -24,8 +25,8 @@ class FTreeDir:
def _walk(self):
for root, _, files in os.walk(self.path):
for f in files:
fpath = os.path.join(root, f)
for file in files:
fpath = os.path.join(root, file)
if must_ignore([fpath], ignores=self.ignores,
debug=self.debug):
continue
@@ -42,4 +43,4 @@ class FTreeDir:
left_only = set(self.entries) - set(other.entries)
right_only = set(other.entries) - set(self.entries)
in_both = set(self.entries) & set(other.entries)
return left_only, right_only, in_both
return list(left_only), list(right_only), list(in_both)