Author: Adam Pioterek <adam.pioterek@protonmail.ch>
gtfs converter is less verbose
converter/converter.py | 12 +-----------
diff --git a/converter/converter.py b/converter/converter.py index c0991ce438383ebef3c1268dfaa855dea03c4cd0..5fa8c383cbe6def4c9d6f131f2a969637ec5fc00 100755 --- a/converter/converter.py +++ b/converter/converter.py @@ -123,27 +123,16 @@ names = ['_'.join((row['start'], row['end'])) for row in self.__metadata] to_stay = [name for name in names if self.__is_valid(name) or self.__will_valid(name)] - print(to_stay) to_stay = self.__clean_overlapping(to_stay) - print(to_stay) to_remove = [name for name in names if name not in to_stay] to_remove = [row['id'] for row in self.__metadata if '_'.join((row['start'], row['end'])) in to_remove] - print(to_remove) - print(self.__metadata) - new_metadata = [] for item in self.__metadata: if item['id'] not in to_remove: new_metadata.append(item) self.__metadata = new_metadata - - print(new_metadata) - - for name in to_remove: - print('{}.db.gz'.format(name)) - Path('{}.db.gz'.format(name)).unlink() class TimetableConverter: @@ -363,3 +352,4 @@ if __name__ == '__main__': downloader = TimetableDownloader() downloader() + print('done')