Diff
Differences From Artifact [1b0bc1277f]:
- File config.py — part of check-in [199c0ad425] at 2014-05-27 00:44:38 on branch trunk — conf.record{} array is back, settings dialog now shows a separate editable table; default options prepared for `youtube-dl` video downloading. Action module now more orderly tries alternative media/* placeholders. (user: mario, size: 7467) [annotate] [blame] [check-ins using]
To Artifact [1418a05152]:
- File config.py — part of check-in [af5ae3f5be] at 2014-05-27 12:37:55 on branch trunk — ListStore row editing callback unified via lambda-funcs as signal handlers. Recording hook adapted to pass actual MIME type. Python3 try/except for json file writing (still breaks due to gzip handler being optional). (user: mario, size: 7615) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
147 148 149 150 151 152 153 |
f = gzip.open(file+".gz", "w")
if os.path.exists(file):
os.unlink(file)
else:
f = open(file, "w")
# encode
data = json.dumps(data, indent=(4 if nice else None))
| > | > > | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
f = gzip.open(file+".gz", "w")
if os.path.exists(file):
os.unlink(file)
else:
f = open(file, "w")
# encode
data = json.dumps(data, indent=(4 if nice else None))
try:
f.write(data.encode("utf-8"))
except TypeError as e:
f.write(data) # Python3 sometimes wants to write strings rather than bytes
f.close()
# retrieve data from config file
def load(self, name):
name = name + ".json"
file = self.dir + "/" + name
|
| ︙ | ︙ |