windows pathnames

This commit is contained in:
j 2016-01-31 22:58:53 +05:30
commit 5dead44107
5 changed files with 38 additions and 8 deletions

View file

@ -657,7 +657,7 @@ class File(db.Model):
def fullpath(self):
prefs = settings.preferences
prefix = os.path.join(os.path.expanduser(prefs['libraryPath']), 'Books/')
prefix = os.sep.join(os.path.join(os.path.expanduser(prefs['libraryPath']), 'Books/').split('/'))
return os.path.join(prefix, self.path)
def make_readonly(self):
@ -672,7 +672,7 @@ class File(db.Model):
def format_underscores(string):
return re.sub('^\.|\.$|:|/|\?|<|>', '_', string)
prefs = settings.preferences
prefix = os.path.join(os.path.expanduser(prefs['libraryPath']), 'Books/')
prefix = os.sep.join(os.path.join(os.path.expanduser(prefs['libraryPath']), 'Books/').split('/'))
j = self.item.json()
current_path = self.fullpath()