[wesnoth_addon_manager] Allow empty lines in ignore lists.

This commit is contained in:
Elias Pschernig 2011-03-20 21:55:30 +00:00
parent 28bc42f04c
commit 915faaf868
2 changed files with 4 additions and 3 deletions

View file

@ -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 + "/*"):

View file

@ -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 = [
".*",