Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit 8999bfb

Browse files
committed
Added version to logs and made a kludge fixing issue #10
1 parent ec0cfbc commit 8999bfb

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

Default.sublime-commands

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
"caption": "ST: Format Current SQL File",
4040
"command": "st_format"
4141
},
42+
{
43+
"caption": "ST: About",
44+
"command": "st_version"
45+
},
4246
{
4347
"caption": "ST: Setup Connections",
4448
"command": "open_file",

SQLTools.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,12 @@ class StFormat(sublime_plugin.TextCommand):
223223
def run(self, edit):
224224
STM.Selection.formatSql(edit)
225225

226+
class StVersion(sublime_plugin.WindowCommand):
227+
def run(self):
228+
sublime.message_dialog('Using SQLTools ' + STM.Const.VERSION)
229+
226230
def plugin_loaded():
227-
STM.Log.debug(__name__ + ' loaded successfully')
231+
STM.Log.debug('%s loaded successfully' % (__name__))
228232
try:
229233
ST.bootstrap()
230234
except Exception as e:

SQLTools.sublime-settings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"debug" : false,
2+
"debug" : true,
33
"thread_timeout" : 5000,
44
"history_size" : 100,
55
"show_result_on_window" : false,

SQLToolsModels.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class Const:
1212
SGDB_FILENAME = "SQLToolsSGBD.{0}".format(SETTINGS_EXTENSION)
1313
CONNECTIONS_FILENAME = "SQLToolsConnections.{0}".format(SETTINGS_EXTENSION)
1414
USER_QUERIES_FILENAME = "SQLToolsSavedQueries.{0}".format(SETTINGS_EXTENSION)
15+
VERSION = "v1.0.8"
1516
pass
1617

1718
class Log:
@@ -20,7 +21,7 @@ class Log:
2021
def debug(message):
2122
if not sublime.load_settings(Const.SETTINGS_FILENAME).get('debug', False):
2223
return
23-
print ("SQLTools: " + message)
24+
print ("SQLTools %s: %s" % (Const.VERSION, message))
2425

2526

2627
class Settings:
@@ -196,6 +197,12 @@ def builArgs(self, queryName=None):
196197
if queryName and len(cliOptions['queries'][queryName]['options']) > 0:
197198
args = args + cliOptions['queries'][queryName]['options']
198199

200+
argsType = 'string'
201+
if type(cliOptions['args']) is list:
202+
argsType = 'list'
203+
cliOptions['args'] = ' '.join(cliOptions['args'])
204+
205+
Log.debug('Usgin cli args (%s) "%s"' %(argsType, cliOptions['args']))
199206
return args + shlex.split(cliOptions['args'].format(**self.options))
200207

201208
def getOptionsForSgdbCli(self):

0 commit comments

Comments
 (0)