[wesnoth_addon_manager] Allow empty lines in ignore lists.
This commit is contained in:
parent
28bc42f04c
commit
915faaf868
2 changed files with 4 additions and 3 deletions
|
@ -314,7 +314,7 @@ class CampaignClient:
|
|||
|
||||
def put_file(name, f):
|
||||
for ig in ign:
|
||||
if ig[-1] != "/" and fnmatch.fnmatch(name, ig):
|
||||
if ig and ig[-1] != "/" and fnmatch.fnmatch(name, ig):
|
||||
print("Ignored file", name)
|
||||
return None
|
||||
fileNode = wmldata.DataSub("file")
|
||||
|
@ -334,9 +334,10 @@ class CampaignClient:
|
|||
|
||||
def put_dir(name, path):
|
||||
for ig in ign:
|
||||
if ig[-1] == "/" and fnmatch.fnmatch(name, ig[:-1]):
|
||||
if ig and ig[-1] == "/" and fnmatch.fnmatch(name, ig[:-1]):
|
||||
print("Ignored dir", name)
|
||||
return None
|
||||
|
||||
dataNode = wmldata.DataSub("dir")
|
||||
dataNode.set_text_val("name", name)
|
||||
for fn in glob.glob(path + "/*"):
|
||||
|
|
|
@ -292,7 +292,7 @@ if __name__ == "__main__":
|
|||
if os.path.exists(ignfile):
|
||||
ign = open(ignfile).readlines()
|
||||
# strip line endings and whitespace
|
||||
ign = [i.strip() for i in ign]
|
||||
ign = [i.strip() for i in ign if i.strip()]
|
||||
else:
|
||||
ign = [
|
||||
".*",
|
||||
|
|
Loading…
Add table
Reference in a new issue