@@ -70,13 +70,12 @@ def __init__(self):
70
70
self ._lock = threading .Lock ()
71
71
72
72
def _write (self , data , newline = True , console = True , content_type = None ):
73
+ text = "%s%s" % (data , "\n " if newline else " " )
74
+
73
75
if conf .api :
74
76
dataToStdout (data , content_type = content_type , status = CONTENT_STATUS .COMPLETE )
75
- return
76
-
77
- text = "%s%s" % (data , "\n " if newline else " " )
78
77
79
- if console :
78
+ elif console :
80
79
dataToStdout (text )
81
80
82
81
multiThreadMode = isMultiThreadMode ()
@@ -118,7 +117,6 @@ def singleString(self, data, content_type=None):
118
117
def string (self , header , data , content_type = None , sort = True ):
119
118
if conf .api :
120
119
self ._write (data , content_type = content_type )
121
- return
122
120
123
121
if isListLike (data ):
124
122
self .lister (header , data , content_type , sort )
@@ -150,7 +148,6 @@ def lister(self, header, elements, content_type=None, sort=True):
150
148
151
149
if conf .api :
152
150
self ._write (elements , content_type = content_type )
153
- return
154
151
155
152
if elements :
156
153
self ._write ("%s [%d]:" % (header , len (elements )))
@@ -202,7 +199,6 @@ def userSettings(self, header, userSettings, subHeader, content_type=None):
202
199
203
200
if conf .api :
204
201
self ._write (userSettings , content_type = content_type )
205
- return
206
202
207
203
if userSettings :
208
204
self ._write ("%s:" % header )
@@ -236,7 +232,6 @@ def dbTables(self, dbTables):
236
232
if isinstance (dbTables , dict ) and len (dbTables ) > 0 :
237
233
if conf .api :
238
234
self ._write (dbTables , content_type = CONTENT_TYPE .TABLES )
239
- return
240
235
241
236
maxlength = 0
242
237
@@ -279,7 +274,6 @@ def dbTableColumns(self, tableColumns, content_type=None):
279
274
if isinstance (tableColumns , dict ) and len (tableColumns ) > 0 :
280
275
if conf .api :
281
276
self ._write (tableColumns , content_type = content_type )
282
- return
283
277
284
278
for db , tables in tableColumns .items ():
285
279
if not db :
@@ -353,7 +347,6 @@ def dbTablesCount(self, dbTables):
353
347
if isinstance (dbTables , dict ) and len (dbTables ) > 0 :
354
348
if conf .api :
355
349
self ._write (dbTables , content_type = CONTENT_TYPE .COUNT )
356
- return
357
350
358
351
maxlength1 = len ("Table" )
359
352
maxlength2 = len ("Entries" )
@@ -412,7 +405,6 @@ def dbTableValues(self, tableValues):
412
405
413
406
if conf .api :
414
407
self ._write (tableValues , content_type = CONTENT_TYPE .DUMP_TABLE )
415
- return
416
408
417
409
dumpDbPath = os .path .join (conf .dumpPath , unsafeSQLIdentificatorNaming (db ))
418
410
@@ -668,7 +660,6 @@ def dbTableValues(self, tableValues):
668
660
def dbColumns (self , dbColumnsDict , colConsider , dbs ):
669
661
if conf .api :
670
662
self ._write (dbColumnsDict , content_type = CONTENT_TYPE .COLUMNS )
671
- return
672
663
673
664
for column in dbColumnsDict .keys ():
674
665
if colConsider == "1" :
0 commit comments