Conversation
|
|
||
| def __init__(self, key): | ||
| self.URL = 'https://www.googleapis.com/qpxExpress/v1/trips/search?key=%s'%key | ||
| self.URL = f'https://www.googleapis.com/qpxExpress/v1/trips/search?key={key}' |
There was a problem hiding this comment.
Function GoogleFlight.__init__ refactored with the following changes:
- Replace interpolated string formatting with f-string (
replace-interpolation-with-fstring)
| Slice = 0 | ||
| for s in trip["slice"]: | ||
| Slice = Slice + 1 | ||
| print (" Slice %s" % Slice) | ||
| for flight in s["segment"]: | ||
| flight_number = flight["flight"]["number"] | ||
| flight_carrier = flight["flight"]["carrier"] | ||
| flight_origin = flight['leg'][0]['origin'] | ||
| flight_departureTime = flight['leg'][0]['departureTime'] | ||
| flight_destination = flight['leg'][0]['destination'] | ||
| flight_arrivalTime = flight['leg'][0]['arrivalTime'] | ||
| flight_mileage = flight['leg'][0]['mileage'] | ||
| print (" %s%s %s %s %s %s %s mileage"%(flight_carrier, flight_number, flight_origin, flight_departureTime, flight_destination, flight_arrivalTime, flight_mileage)) | ||
| Slice = 0 | ||
| for s in trip["slice"]: | ||
| Slice = Slice + 1 | ||
| print(f" Slice {Slice}") | ||
| for flight in s["segment"]: | ||
| flight_number = flight["flight"]["number"] | ||
| flight_carrier = flight["flight"]["carrier"] | ||
| flight_origin = flight['leg'][0]['origin'] | ||
| flight_departureTime = flight['leg'][0]['departureTime'] | ||
| flight_destination = flight['leg'][0]['destination'] | ||
| flight_arrivalTime = flight['leg'][0]['arrivalTime'] | ||
| flight_mileage = flight['leg'][0]['mileage'] | ||
| print( | ||
| f" {flight_carrier}{flight_number} {flight_origin} {flight_departureTime} {flight_destination} {flight_arrivalTime} {flight_mileage} mileage" | ||
| ) |
There was a problem hiding this comment.
Function GoogleFlight.print_trip refactored with the following changes:
- Replace interpolated string formatting with f-string [×2] (
replace-interpolation-with-fstring)
|
|
There was a problem hiding this comment.
Found the following improvement in Function GoogleFlight.lowest:
Sourcery Code Quality Report❌ Merging this PR will decrease code quality in the affected files by 0.44%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
Branch
masterrefactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
masterbranch, then run:Help us improve this pull request!