Skip to content

Commit

Permalink
improved settings 2
Browse files Browse the repository at this point in the history
  • Loading branch information
akalongman committed Dec 18, 2013
1 parent 34562dd commit 840f3ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions AutoBackups.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import autobackups.reloader
from autobackups.paths_helper import PathsHelper

# fix for ST2
cprint = globals()["__builtins__"]["print"]


Expand All @@ -41,8 +42,10 @@ def plugin_loaded():
global hashes
hashes = {}
platform = sublime.platform().title()
settings = sublime.load_settings('AutoBackups.sublime-settings')
print('Plugin AutoBackups Initialized')
if (platform == "Osx"):
platform = "OSX"
settings = sublime.load_settings('AutoBackups ('+platform+').sublime-settings')
cprint('AutoBackups: Plugin Initialized')


if st_version == 2:
Expand Down
8 changes: 6 additions & 2 deletions autobackups/paths_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ class PathsHelper(object):
@staticmethod
def get_base_dir(only_base):
platform = sublime.platform().title()
settings = sublime.load_settings('AutoBackups.sublime-settings')
if (platform == "Osx"):
platform = "OSX"
settings = sublime.load_settings('AutoBackups ('+platform+').sublime-settings')
# Configured setting
backup_dir = settings.get('backup_dir')
now_date = str(datetime.datetime.now())
Expand Down Expand Up @@ -46,7 +48,9 @@ def get_base_dir(only_base):
def timestamp_file(filename):
(filepart, extensionpart) = os.path.splitext(filename)
platform = sublime.platform().title()
settings = sublime.load_settings('AutoBackups.sublime-settings')
if (platform == "Osx"):
platform = "OSX"
settings = sublime.load_settings('AutoBackups ('+platform+').sublime-settings')
backup_per_day = settings.get('backup_per_day')
backup_per_time = settings.get('backup_per_time')
if (backup_per_day and backup_per_time == 'file'):
Expand Down

0 comments on commit 840f3ae

Please sign in to comment.