@@ -70,13 +70,12 @@ def __init__(self):
7070 self ._lock = threading .Lock ()
7171
7272 def _write (self , data , newline = True , console = True , content_type = None ):
73+ text = "%s%s" % (data , "\n " if newline else " " )
74+
7375 if conf .api :
7476 dataToStdout (data , content_type = content_type , status = CONTENT_STATUS .COMPLETE )
75- return
76-
77- text = "%s%s" % (data , "\n " if newline else " " )
7877
79- if console :
78+ elif console :
8079 dataToStdout (text )
8180
8281 multiThreadMode = isMultiThreadMode ()
@@ -118,7 +117,6 @@ def singleString(self, data, content_type=None):
118117 def string (self , header , data , content_type = None , sort = True ):
119118 if conf .api :
120119 self ._write (data , content_type = content_type )
121- return
122120
123121 if isListLike (data ):
124122 self .lister (header , data , content_type , sort )
@@ -150,7 +148,6 @@ def lister(self, header, elements, content_type=None, sort=True):
150148
151149 if conf .api :
152150 self ._write (elements , content_type = content_type )
153- return
154151
155152 if elements :
156153 self ._write ("%s [%d]:" % (header , len (elements )))
@@ -202,7 +199,6 @@ def userSettings(self, header, userSettings, subHeader, content_type=None):
202199
203200 if conf .api :
204201 self ._write (userSettings , content_type = content_type )
205- return
206202
207203 if userSettings :
208204 self ._write ("%s:" % header )
@@ -236,7 +232,6 @@ def dbTables(self, dbTables):
236232 if isinstance (dbTables , dict ) and len (dbTables ) > 0 :
237233 if conf .api :
238234 self ._write (dbTables , content_type = CONTENT_TYPE .TABLES )
239- return
240235
241236 maxlength = 0
242237
@@ -279,7 +274,6 @@ def dbTableColumns(self, tableColumns, content_type=None):
279274 if isinstance (tableColumns , dict ) and len (tableColumns ) > 0 :
280275 if conf .api :
281276 self ._write (tableColumns , content_type = content_type )
282- return
283277
284278 for db , tables in tableColumns .items ():
285279 if not db :
@@ -353,7 +347,6 @@ def dbTablesCount(self, dbTables):
353347 if isinstance (dbTables , dict ) and len (dbTables ) > 0 :
354348 if conf .api :
355349 self ._write (dbTables , content_type = CONTENT_TYPE .COUNT )
356- return
357350
358351 maxlength1 = len ("Table" )
359352 maxlength2 = len ("Entries" )
@@ -412,7 +405,6 @@ def dbTableValues(self, tableValues):
412405
413406 if conf .api :
414407 self ._write (tableValues , content_type = CONTENT_TYPE .DUMP_TABLE )
415- return
416408
417409 dumpDbPath = os .path .join (conf .dumpPath , unsafeSQLIdentificatorNaming (db ))
418410
@@ -668,7 +660,6 @@ def dbTableValues(self, tableValues):
668660 def dbColumns (self , dbColumnsDict , colConsider , dbs ):
669661 if conf .api :
670662 self ._write (dbColumnsDict , content_type = CONTENT_TYPE .COLUMNS )
671- return
672663
673664 for column in dbColumnsDict .keys ():
674665 if colConsider == "1" :
0 commit comments