skip add-ons when there is a parse error instead of aborting
This commit is contained in:
parent
3536811e48
commit
f9eb4753d7
1 changed files with 9 additions and 5 deletions
|
@ -222,12 +222,16 @@ class WesnothList:
|
|||
"""
|
||||
Find all addon eras and campaigns.
|
||||
"""
|
||||
WML = self.parser.parse("""
|
||||
#define MULTIPLAYER\n#enddef
|
||||
#define RANDOM_SIDE\n#enddef
|
||||
{~campaigns}
|
||||
""")
|
||||
n = 0
|
||||
try:
|
||||
WML = self.parser.parse("""
|
||||
#define MULTIPLAYER\n#enddef
|
||||
#define RANDOM_SIDE\n#enddef
|
||||
{~campaigns}
|
||||
""")
|
||||
except Exception, e:
|
||||
print e
|
||||
return n
|
||||
for campaign in WML.find_all("campaign"):
|
||||
cid = self.add_campaign(campaign)
|
||||
n += 1
|
||||
|
|
Loading…
Add table
Reference in a new issue