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

Commit 230d4c3

Browse files
committed
sáb out 29 15:16:50 BRST 2016
1 parent a7dcb02 commit 230d4c3

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

SQLToolsAPI/Connection.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self, name, options, settings={}, commandClass='ThreadCommand'):
2929

3030
if cli_path is None:
3131
Log((
32-
"'{0}' could not be found by Sublime Text.\n\n" +
32+
"'{0}' could not be found.\n\n" +
3333
"Please set the '{0}' path in your SQLTools settings " +
3434
"before continue.").format(self.cli))
3535
return
@@ -38,14 +38,14 @@ def __init__(self, name, options, settings={}, commandClass='ThreadCommand'):
3838
self.rowsLimit = settings.get('show_records', {}).get('limit', 50)
3939
self.options = options
4040
self.name = name
41-
self.type = options['type']
42-
self.database = options['database']
43-
self.host = options['host'] if 'host' in options else None
44-
self.port = options['port'] if 'port' in options else None
45-
self.username = options['username'] if 'username' in options else None
46-
self.encoding = options['encoding'] if 'encoding' in options else None
47-
self.password = options['password'] if 'password' in options else None
48-
self.service = options['service'] if 'service' in options else None
41+
self.type = options.get('type', None)
42+
self.database = options.get('database', None)
43+
self.host = options.get('host', None)
44+
self.port = options.get('port', None)
45+
self.username = options.get('username', None)
46+
self.encoding = options.get('encoding', None)
47+
self.password = options.get('password', None)
48+
self.service = options.get('service', None)
4949

5050
def __str__(self):
5151
return self.name

SQLToolsAPI/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
## SQLTools API for plugins - v0.2.4
1+
## SQLTools API for plugins - v0.2.5
22

33
Docs will be ready soon

SQLToolsAPI/Storage.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import shutil
23
from . import Utils as U
34

45
__version__ = "v0.1.0"
@@ -10,8 +11,9 @@ def __init__(self, filename, default=None):
1011
self.defaultFile = default
1112
self.items = {}
1213

13-
if not os.path.isfile(filename):
14-
U.saveJson(self.defaults(), filename)
14+
#copy entire file, to keep comments
15+
if not os.path.isfile(filename) and default and os.path.isfile(default):
16+
shutil.copyfile(default, filename)
1517

1618
self.all()
1719

SQLToolsAPI/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "v0.2.4"
1+
__version__ = "v0.2.5"
22

33

44
__all__ = [

0 commit comments

Comments
 (0)