Fixed to work with different line terminators on Linux.
This commit is contained in:
parent
3aea24b725
commit
14ba52d95a
@ -121,7 +121,8 @@ def read_in_source_dir(projdir):
|
|||||||
if os.path.isfile(path) and entry.lower().endswith(".vb"):
|
if os.path.isfile(path) and entry.lower().endswith(".vb"):
|
||||||
modname = entry[0:-3]
|
modname = entry[0:-3]
|
||||||
f = open(path)
|
f = open(path)
|
||||||
modules[modname] = f.read().decode("utf-8")
|
modules[modname] = f.read().decode("utf-8").replace(
|
||||||
|
"\r\n", "\n")
|
||||||
f.close()
|
f.close()
|
||||||
return modules
|
return modules
|
||||||
|
|
||||||
@ -144,7 +145,7 @@ def update_source_dir(projdir, modules):
|
|||||||
else:
|
else:
|
||||||
path = os.path.join(projdir, curmods[modname])
|
path = os.path.join(projdir, curmods[modname])
|
||||||
f = open(path, "r+")
|
f = open(path, "r+")
|
||||||
if modules[modname] != f.read():
|
if modules[modname] != f.read().replace("\r\n", "\n"):
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
f.write(modules[modname])
|
f.write(modules[modname])
|
||||||
print >> sys.stderr, curmods[modname] + " updated."
|
print >> sys.stderr, curmods[modname] + " updated."
|
||||||
|
Loading…
Reference in New Issue
Block a user