Diff
Differences From Artifact [19c9d0f2fd]:
- File config.py — part of check-in [ef4ea389f1] at 2020-12-12 14:17:07 on branch trunk — Fix `format_exc(e)` itself causing an exception, and add explanation in `pq` wrapper which was supposed to mask import errors. (user: mario, size: 14789) [annotate] [blame] [check-ins using]
To Artifact [1f95c979da]:
- File config.py — part of check-in [de206be857] at 2022-09-16 05:02:43 on branch trunk — also create CACHEDIR.TAG for data subdirs (user: mario, size: 14847) [annotate] [blame] [check-ins using]
| ︙ | |||
254 255 256 257 258 259 260 261 262 263 264 265 266 267 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | + |
# check for subdir
if (name.find("/") > 0):
subdir = name[0:name.find("/")]
subdir = self.datadir + "/" + subdir
if (not os.path.exists(subdir)):
os.mkdir(subdir)
open(subdir+"/.nobackup", "w").close()
open(subdir+"/CACHEDIR.TAG", "w").close()
file = self.datadir + "/" + name
# encode as JSON
try:
data = json.dumps(data, indent=(4 if nice else None), sort_keys=True)
except Exception as e:
log.ERR("JSON encoding failed", e)
return
|
| ︙ |