make sure folder exists
This commit is contained in:
parent
b961086475
commit
fa916d11b7
1 changed files with 2 additions and 1 deletions
|
@ -338,13 +338,14 @@ class List(db.Model):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def export_json(self, path=None):
|
def export_json(self, path=None):
|
||||||
|
from utils import _to_json
|
||||||
if not path:
|
if not path:
|
||||||
if self.name:
|
if self.name:
|
||||||
name = os.path.join('Lists', self.name)
|
name = os.path.join('Lists', self.name)
|
||||||
else:
|
else:
|
||||||
name = 'Books'
|
name = 'Books'
|
||||||
path = os.path.join(os.path.expanduser(settings.preferences['libraryPath']), name, 'library.json')
|
path = os.path.join(os.path.expanduser(settings.preferences['libraryPath']), name, 'library.json')
|
||||||
from utils import _to_json
|
ox.makedirs(os.path.dirname(path))
|
||||||
items = []
|
items = []
|
||||||
for i in self.get_items():
|
for i in self.get_items():
|
||||||
j = i.json()
|
j = i.json()
|
||||||
|
|
Loading…
Reference in a new issue