PyTransportNSWv2 0.5.1__tar.gz → 0.5.3__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.1
3
+ Version: 0.5.3
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.1
3
+ Version: 0.5.3
4
4
  Summary: Get detailed per-trip transport information from TransportNSW
5
5
  Home-page: https://github.com/andystewart999/TransportNSW
6
6
  Author: andystewart999
@@ -290,14 +290,20 @@ class TransportNSWv2(object):
290
290
  found_journeys = found_journeys + 1
291
291
 
292
292
  # Add to the return array
293
- if (found_journeys == journeys_to_return) or (no_valid_journeys == True):
294
- json_output = json_output + json.dumps(self.info) + ']}'
295
- json_output='{"journeys_to_return": ' + str(self.journeys_to_return) + ', "journeys_with_data": ' + str(found_journeys) + ', "journeys": [' + json_output
293
+ if (no_valid_journeys == True):
296
294
  break
295
+
296
+ if (found_journeys >= 2):
297
+ json_output = json_output + ',' + json.dumps(self.info)
297
298
  else:
298
- json_output = json_output + json.dumps(self.info) + ', '
299
- current_journey = next_journey
299
+ json_output = json_output + json.dumps(self.info)
300
+
301
+ if (found_journeys == journeys_to_return):
302
+ break
303
+
304
+ current_journey = next_journey
300
305
 
306
+ json_output='{"journeys_to_return": ' + str(self.journeys_to_return) + ', "journeys_with_data": ' + str(found_journeys) + ', "journeys": [' + json_output + ']}'
301
307
  return json_output
302
308
 
303
309
 
@@ -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.1",
8
+ version="0.5.3",
9
9
  author="andystewart999",
10
10
  description="Get detailed per-trip transport information from TransportNSW",
11
11
  long_description=long_description,