254
255
256
257
258
259
260
261
262
263
264
265
266
267 | # 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()
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 |
>
| 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 |