From 20267b598129c0c6dd6ce3b4fe7699117524866c Mon Sep 17 00:00:00 2001 From: bordaigorl Date: Tue, 16 Sep 2014 11:06:11 +0100 Subject: [PATCH] Fetching the `DEBUG` flag from settings --- sublime_evernote.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sublime_evernote.py b/sublime_evernote.py index cae9d48..29ef900 100644 --- a/sublime_evernote.py +++ b/sublime_evernote.py @@ -42,14 +42,12 @@ SUBLIME_EVERNOTE_COMMENT_BEG = "" -DEBUG = True +DEBUG = False -if DEBUG: - def LOG(*args): + +def LOG(*args): + if DEBUG: print("Evernote:", *args) -else: - def LOG(*args): - pass def extractTags(tags): @@ -231,7 +229,9 @@ def get_user_id(self, token=None): return int(id, 16) def load_settings(self): + global DEBUG self.settings = sublime.load_settings(EVERNOTE_SETTINGS) + DEBUG = bool(self.settings.get('debug')) pygm_style = self.settings.get('code_highlighting_style') if pygm_style: EvernoteDo.MD_EXTRAS['fenced-code-blocks']['style'] = pygm_style