From a101fa0f125e1645efbcec2392759112f36ecd60 Mon Sep 17 00:00:00 2001 From: Nikolajus Date: Tue, 23 Apr 2013 12:49:30 +0200 Subject: [PATCH] Fixing issue #21 moving loading of configuration to async callback function plugin_loaded --- PrettyJson.py | 5 +++++ tests.py => tests/tests.py | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) rename tests.py => tests/tests.py (90%) diff --git a/PrettyJson.py b/PrettyJson.py index 7c868ec..b69e833 100644 --- a/PrettyJson.py +++ b/PrettyJson.py @@ -41,3 +41,8 @@ class PrettyjsonCommand(sublime_plugin.TextCommand): import sys exc = sys.exc_info()[1] sublime.status_message(str(exc)) + + +def plugin_loaded(): + global s + s = sublime.load_settings("Pretty JSON.sublime-settings") \ No newline at end of file diff --git a/tests.py b/tests/tests.py similarity index 90% rename from tests.py rename to tests/tests.py index e264043..658e590 100644 --- a/tests.py +++ b/tests/tests.py @@ -1,5 +1,12 @@ -import simplejson as json -from simplejson import OrderedDict +try: + # python 3 / Sublime Text 3 + from . import simplejson as json + from .simplejson import OrderedDict +except (ValueError): + # python 2 / Sublime Text 2 + import simplejson as json + from simplejson import OrderedDict + import decimal import unittest