mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-08 15:28:42 +00:00
[wmlunits] fixed some problems with latin1 filenames
This commit is contained in:
parent
e948226de7
commit
5431f82643
@ -139,7 +139,8 @@ class ImageCollector:
|
|||||||
p.wait()
|
p.wait()
|
||||||
else:
|
else:
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
"Warning: Required image %s: \"%s\" does not exist.\n" % (c, i))
|
"Warning: Required image %s: \"%s\" does not exist.\n" % (
|
||||||
|
repr(c), repr(i)))
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
sys.stderr.write("Warning: Looked at the following locations:\n")
|
sys.stderr.write("Warning: Looked at the following locations:\n")
|
||||||
sys.stderr.write("\n".join(bases) + "\n")
|
sys.stderr.write("\n".join(bases) + "\n")
|
||||||
@ -352,7 +353,10 @@ class WesnothList:
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
("Error: Era '%s' faction '%s' references " +
|
("Error: Era '%s' faction '%s' references " +
|
||||||
"non-existant unit id '%s'!\n") % (eid, fid, uid))
|
"non-existant unit id '%s'!\n") % (
|
||||||
|
eid,
|
||||||
|
fid,
|
||||||
|
repr(uid)))
|
||||||
continue
|
continue
|
||||||
if not eid in unit.eras:
|
if not eid in unit.eras:
|
||||||
unit.eras.append(eid)
|
unit.eras.append(eid)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
# encoding: utf8
|
||||||
import wmldata, os, glob, sys
|
import wmldata, os, glob, sys
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@ -385,10 +385,14 @@ class Parser:
|
|||||||
return None
|
return None
|
||||||
# If it is a directory, parse all cfg files within.
|
# If it is a directory, parse all cfg files within.
|
||||||
if os.path.isdir(dirpath):
|
if os.path.isdir(dirpath):
|
||||||
|
# Note: glob.glob will try to return unicode filenames
|
||||||
|
# if you pass it an unicode string - but to deal with
|
||||||
|
# non-unicode filenames as are allowed in linux we
|
||||||
|
# convert to a byte-string.
|
||||||
# Execute all WML files in the directory.
|
# Execute all WML files in the directory.
|
||||||
files = glob.glob(dirpath + "/*.cfg")
|
files = glob.glob(str(dirpath + "/*.cfg"))
|
||||||
# And also execute directories with a _main.cfg.
|
# And also execute directories with a _main.cfg.
|
||||||
files += glob.glob(dirpath + "/*/_main.cfg")
|
files += glob.glob(str(dirpath + "/*/_main.cfg"))
|
||||||
files.sort()
|
files.sort()
|
||||||
mc = dirpath + "/_main.cfg"
|
mc = dirpath + "/_main.cfg"
|
||||||
fc = dirpath + "/_final.cfg"
|
fc = dirpath + "/_final.cfg"
|
||||||
|
@ -111,7 +111,7 @@ class HTMLOutput:
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
"Warning: Unit %s not found as advancement of %s\n" %
|
"Warning: Unit %s not found as advancement of %s\n" %
|
||||||
(auid, uid))
|
(auid, repr(uid)))
|
||||||
continue
|
continue
|
||||||
forest.add_node(helpers.UnitNode(au))
|
forest.add_node(helpers.UnitNode(au))
|
||||||
new_units_added[auid] = au
|
new_units_added[auid] = au
|
||||||
|
Loading…
x
Reference in New Issue
Block a user