File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,12 +59,12 @@ def parseargv(): #parses argv, returns StopID and LineID
5959 global DEBUG
6060 DEBUG = True
6161 else :
62- print ("What's this?: { }" .format (elem ))
62+ print ("Unknown parameter {!r }" .format (elem ))
6363 query_ids .sort (key = int )
6464 return (query_stop , query_ids )
6565
66- def getjson ():
67- (stop , ids ) = parseargv ()
66+ def getjson (data ):
67+ (stop , ids ) = data
6868 stop_filter = filter_s .format (stop )
6969 if (ids == []):
7070 line_filter = ""
@@ -91,24 +91,25 @@ def parsejson(data):
9191 output .sort (key = lambda tup : tup [0 ])
9292 return output
9393
94- def info ():
95- (query_stop , query_ids ) = parseargv ()
94+ def info (data ):
95+ (stop , ids ) = data
9696 try :
97- halt = stops [query_stop ].strip ()
97+ halt = stops [stop ].strip ()
9898 except :
9999 print ("Error: Invalid StopID" )
100100 exit (1 )
101- haltid = query_stop
102- linien = " " .join (query_ids )
101+ haltid = stop
102+ linien = " " .join (ids )
103103 out = infotext .format (halt , haltid , linien )
104104 debug (out )
105105
106+ data = parseargv ()
106107
107108debug ('=== Start' )
108- info ()
109+ info (data )
109110
110111debug ('=== Get JSON' )
111- jsondata = getjson ()
112+ jsondata = getjson (data )
112113
113114debug ('=== Parse JSON' )
114115output = parsejson (jsondata )
You can’t perform that action at this time.
0 commit comments