@@ -300,7 +300,7 @@ def load_file(self, dialogtitle, filterstring, filter=["(*.brp)", "(*.*)"]):
300
300
301
301
def GetISO639_country_code (self ):
302
302
list = OSMutils .omsutils_get_iso639_code ()
303
- print ( list )
303
+
304
304
return list
305
305
306
306
def ReadTransportData (self , city , transport_type , iso639_city_code , place_id ):
@@ -312,9 +312,10 @@ def ReadTransportData (self, city, transport_type, iso639_city_code, place_id):
312
312
def GetTransportLines (self ):
313
313
#ret = self.osmt.GetTransportLineList ()
314
314
ret = self .osmt .GetTransportDataLineList ()
315
-
316
- print ("GetTransportLineList" , ret )
317
- return ret
315
+ print ("ret" , ret , type (ret ))
316
+ resstr = json .dumps (ret , ensure_ascii = False )
317
+ print ("GetTransportLineList" , resstr )
318
+ return resstr
318
319
319
320
def GetTransportDataSvg (self , linelist , drawstation , linestrategy , polygon ):
320
321
print ("GetTransportSVG" , linelist , drawstation , int (linestrategy ), type (linestrategy ))
@@ -324,10 +325,13 @@ def GetTransportDataSvg (self, linelist, drawstation, linestrategy, polygon):
324
325
return svg
325
326
326
327
def GetTransportData (self , linelist , drawstation , linestrategy , polygon ):
327
- svg = self .GetTransportDataSvg (linelist , drawstation , linestrategy , polygon )
328
- liststation = self .osmt .GetTransportDataStations (linelist )
328
+ linearray = json .loads (linelist )
329
+ #print ("json decoded", linearray )
330
+ svg = self .GetTransportDataSvg (linearray , drawstation , linestrategy , polygon )
331
+ liststation = self .osmt .GetTransportDataStations (linearray )
329
332
330
- return json .dumps ({"svg" : svg , "stations" : liststation })
333
+ str = json .dumps ({"svg" : svg , "stations" : liststation }, ensure_ascii = False )
334
+ return str
331
335
332
336
def GetTransportSVGbase64 (self ):
333
337
svg = self .osmt .get_svg ()
@@ -389,9 +393,15 @@ def delete_splash(window):
389
393
api = Api ()
390
394
debugihm = False
391
395
396
+ # redirect stdout to file for debug purpose
397
+ #f = open("output.log", 'w')
398
+ f = open (os .devnull , 'w' )
399
+ sys .stdout = f
400
+
392
401
#print(sys.argv)
393
402
dir , script = os .path .splitext (sys .argv [0 ])
394
- if len (sys .argv ) > 1 and script == ".py" :
403
+ #if len(sys.argv) > 1 and script == ".py":
404
+ if len (sys .argv ) > 1 :
395
405
if sys .argv [1 ] == "--debug" :
396
406
debugihm = True
397
407
0 commit comments