fix newlines in peristent weather/remember
This commit is contained in:
parent
e01d2b1d6b
commit
ff37c5f7cb
|
@ -20,7 +20,7 @@ def load_memory(filename, mtimes={}):
|
||||||
mtime = os.stat(filename).st_mtime
|
mtime = os.stat(filename).st_mtime
|
||||||
if mtimes.get(filename, 0) != mtime:
|
if mtimes.get(filename, 0) != mtime:
|
||||||
mtimes[filename] = mtime
|
mtimes[filename] = mtime
|
||||||
return dict((x.split(None, 1)[0].lower(), x) for x in
|
return dict((x.split(None, 1)[0].lower(), x.strip()) for x in
|
||||||
codecs.open(filename, 'r', 'utf-8'))
|
codecs.open(filename, 'r', 'utf-8'))
|
||||||
|
|
||||||
def save_memory(filename, memory):
|
def save_memory(filename, memory):
|
||||||
|
|
|
@ -20,7 +20,7 @@ def load_stalk(filename, mtimes={}):
|
||||||
mtime = os.stat(filename).st_mtime
|
mtime = os.stat(filename).st_mtime
|
||||||
if mtimes.get(filename, 0) != mtime:
|
if mtimes.get(filename, 0) != mtime:
|
||||||
mtimes[filename] = mtime
|
mtimes[filename] = mtime
|
||||||
return dict(x.split(None, 1) for x in
|
return dict(x.strip().split(None, 1) for x in
|
||||||
codecs.open(filename, 'r', 'utf-8'))
|
codecs.open(filename, 'r', 'utf-8'))
|
||||||
|
|
||||||
def save_stalk(filename, houses):
|
def save_stalk(filename, houses):
|
||||||
|
|
Loading…
Reference in New Issue