PyTransportNSWv2 0.5.4__tar.gz → 0.5.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyTransportNSWv2
3
- Version: 0.5.4
3
+ Version: 0.5.5
4
4
  Summary: Get detailed per-trip transport information from TransportNSW
5
5
  Home-page: https://github.com/andystewart999/TransportNSW
6
6
  Author: andystewart999
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyTransportNSWv2
3
- Version: 0.5.4
3
+ Version: 0.5.5
4
4
  Summary: Get detailed per-trip transport information from TransportNSW
5
5
  Home-page: https://github.com/andystewart999/TransportNSW
6
6
  Author: andystewart999
@@ -134,7 +134,6 @@ class TransportNSWv2(object):
134
134
  exit
135
135
 
136
136
  retrieved_journeys = len(result['journeys'])
137
- print ("retrieved_journeys = " + str(retrieved_journeys))
138
137
 
139
138
  # Loop through the results applying filters where required, and generate the appropriate JSON output including an array of in-scope trips
140
139
  json_output=''
@@ -142,22 +141,16 @@ class TransportNSWv2(object):
142
141
  no_valid_journeys = False
143
142
 
144
143
  for current_journey_index in range (0, retrieved_journeys, 1):
145
- print(current_journey_index)
146
144
  if transport_type == 0:
147
145
  # Just grab the next trip
148
146
  journey = result['journeys'][current_journey_index]
149
147
  next_journey_index = current_journey_index + 1
150
148
  else:
151
149
  # Look for a trip with a matching class filter in at least one of its legs. Either ANY, or the first leg, depending on how strict we're being
152
- print ("transport_type = " + str(transport_type))
153
150
  journey, next_journey_index = self.find_next_journey(result['journeys'], current_journey_index, transport_type, strict_transport_type)
154
- if (journey is None):
155
- print ("Just called find_next_journey")
156
- print ("journey is None")
157
151
 
158
152
  if ((journey is None) or (journey['legs']) is None):
159
- print ("This journey isn't valid, moving to the next one")
160
-
153
+ pass
161
154
  else:
162
155
  legs = journey['legs']
163
156
  first_leg = self.find_first_leg(legs, transport_type, strict_transport_type)
@@ -231,7 +224,6 @@ class TransportNSWv2(object):
231
224
 
232
225
  # Unfortunately we need to do some mucking about for train-based trip_ids
233
226
  # Define the appropriate regular expression to search for - usually just the full text
234
- print ( feed.entity[0] )
235
227
  bFindLocation = True
236
228
 
237
229
  if origin_mode == 'Train':
@@ -308,21 +300,16 @@ class TransportNSWv2(object):
308
300
  def find_next_journey(self, journeys, start_journey_index, journeytype, strict):
309
301
  # Fnd the next journey that has a leg of the requested type
310
302
  journey_count = len(journeys)
311
- print ("(find_next_journey): start_journey_index = " + str(start_journey_index))
312
- print ("(find_next_journey): journey_count = " + str(journey_count))
313
303
 
314
304
  # Some basic error checking
315
305
  if start_journey_index > journey_count:
316
- print ("None, None")
317
306
  return None, None
318
307
 
319
308
  for journey_index in range (start_journey_index, journey_count, 1):
320
309
  leg = self.find_first_leg(journeys[journey_index]['legs'], journeytype, strict)
321
310
  if leg is not None:
322
- print ("leg is not None")
323
311
  return journeys[journey_index], journey_index + 1
324
312
  else:
325
- print ("leg is None, None")
326
313
  return None, None
327
314
 
328
315
  # Hmm, we didn't find one
@@ -332,10 +319,8 @@ class TransportNSWv2(object):
332
319
  def find_first_leg(self, legs, legtype, strict):
333
320
  # Find the first leg of the requested type
334
321
  leg_count = len(legs)
335
- print ("leg_count = " + str(leg_count))
336
322
  for leg_index in range (0, leg_count, 1):
337
323
  leg_class = legs[leg_index]['transportation']['product']['class']
338
- print("leg_class = " + str(leg_class))
339
324
  # We've got a filter, and the leg type matches it, so return that leg
340
325
  if legtype != 0 and leg_class == legtype:
341
326
  return legs[leg_index]
@@ -349,7 +334,6 @@ class TransportNSWv2(object):
349
334
  return None
350
335
 
351
336
  # Hmm, we didn't find one
352
- print ("Fell through to None")
353
337
  return None
354
338
 
355
339
 
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="PyTransportNSWv2",
8
- version="0.5.4",
8
+ version="0.5.5",
9
9
  author="andystewart999",
10
10
  description="Get detailed per-trip transport information from TransportNSW",
11
11
  long_description=long_description,