Skip to content

Commit

Permalink
Fix path to orgmode-store.bin.gz
Browse files Browse the repository at this point in the history
sublime.packages_path() returns a directory, there's no need to use dirname on it.
os.path.join is a better way to construct system paths, abspath ensures we have an absolute path.
  • Loading branch information
jiffyclub committed Sep 19, 2014
1 parent df7442a commit 21e53a5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions orgmode_store.py
@@ -1,6 +1,6 @@
from gzip import GzipFile
from os import makedirs
from os.path import dirname
from os.path import dirname, join, abspath
from pickle import load, dump
import sublime
import sublime_plugin
Expand All @@ -11,8 +11,10 @@ class OrgmodeStore(sublime_plugin.EventListener):
def __init__(self, *args, **kwargs):
self.debug = False
self.db = {}
self.store = dirname(
sublime.packages_path()) + '/Settings/orgmode-store.bin.gz'
self.store = join(
abspath(sublime.packages_path()),
'Settings',
'orgmode-store.bin.gz')
try:
makedirs(dirname(self.store))
except:
Expand Down Expand Up @@ -156,4 +158,4 @@ def _is_region_folded(self, region, view):
for i in view.folded_regions():
if i.contains(region):
return True
return False
return False

0 comments on commit 21e53a5

Please sign in to comment.