keys are case-sensitive, don't lowercase them

This commit is contained in:
4am 2018-05-31 11:01:41 -04:00
parent 86ca60775e
commit 862b58b492
2 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,9 @@
#!/usr/bin/env python3
from passport import *
from passport import eddimage, wozimage
from passport import DefaultLogger, DebugLogger
from passport import Crack, Verify, EDDToWoz
import os.path
import sys
def usage(error_code):
@ -32,7 +35,7 @@ ext = ext.lower()
if ext == ".woz":
reader = wozimage.WozReader
elif ext == ".edd":
reader = wozimage.EDDReader
reader = eddimage.EDDReader
else:
print("unrecognized file type")
usage(1)

View File

@ -441,17 +441,15 @@ class CommandEdit(BaseCommand):
output = WozWriter(self.woz_image.info.get("creator", __displayname__))
output.tmap = self.woz_image.tmap
output.tracks = self.woz_image.tracks
output.info = self.woz_image.info
output.meta = self.woz_image.meta
output.info = self.woz_image.info.copy()
output.meta = self.woz_image.meta.copy()
# add all new info fields
for i in args.info or ():
k, v = i.split(":", 1)
k = k.lower()
output.info[k] = v
# add all new metadata fields
for m in args.meta or ():
k, v = m.split(":", 1)
k = k.lower()
v = v.split("|")
if len(v) == 1:
v = v[0]