From ef84912dbefb18aa337a10c030fd462cb03977c5 Mon Sep 17 00:00:00 2001 From: Felix Delattre Date: Wed, 11 Dec 2019 19:01:27 +0000 Subject: [PATCH] Remove all unused imports --- extensions/googletransit/pybcp47/bcp47languageparser.py | 2 -- feedvalidator.py | 2 -- kmlparser.py | 3 --- kmlwriter.py | 1 - merge.py | 1 - misc/sql_loop.py | 1 - schedule_viewer.py | 4 ++-- shape_importer.py | 3 --- tests/testfeedvalidator.py | 2 -- tests/transitfeed/testfeedinfo.py | 1 - transitfeed/farerule.py | 1 - transitfeed/problems.py | 2 +- transitfeed/serviceperiod.py | 1 - transitfeed/shapelib.py | 2 -- transitfeed/shapepoint.py | 2 -- transitfeed/util.py | 3 +-- unusual_trip_filter.py | 5 ----- visualize_pathways.py | 1 - 18 files changed, 4 insertions(+), 33 deletions(-) diff --git a/extensions/googletransit/pybcp47/bcp47languageparser.py b/extensions/googletransit/pybcp47/bcp47languageparser.py index 289dff21..fa22d0f8 100644 --- a/extensions/googletransit/pybcp47/bcp47languageparser.py +++ b/extensions/googletransit/pybcp47/bcp47languageparser.py @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import codecs -import os from pkg_resources import resource_string import re import string diff --git a/feedvalidator.py b/feedvalidator.py index 06de811e..a6a25390 100755 --- a/feedvalidator.py +++ b/feedvalidator.py @@ -22,10 +22,8 @@ from __future__ import print_function import bisect -import codecs import datetime from transitfeed.util import defaultdict -import optparse import os import os.path import re diff --git a/kmlparser.py b/kmlparser.py index 993a8523..f051a4e4 100755 --- a/kmlparser.py +++ b/kmlparser.py @@ -30,12 +30,9 @@ from __future__ import print_function import re -import string -import sys import transitfeed from transitfeed import util import xml.dom.minidom as minidom -import zipfile class Placemark(object): diff --git a/kmlwriter.py b/kmlwriter.py index 34163d9b..1921936e 100755 --- a/kmlwriter.py +++ b/kmlwriter.py @@ -75,7 +75,6 @@ except ImportError as e: import elementtree.ElementTree as ET # older pythons import extensions.googletransit as googletransit -import optparse import os.path import sys import transitfeed diff --git a/merge.py b/merge.py index 0991096d..ae681de4 100755 --- a/merge.py +++ b/merge.py @@ -43,7 +43,6 @@ import datetime -import optparse import os import re import sys diff --git a/misc/sql_loop.py b/misc/sql_loop.py index 297105ac..cd9ed7e7 100755 --- a/misc/sql_loop.py +++ b/misc/sql_loop.py @@ -23,7 +23,6 @@ import csv import os import os.path -import resource import pstats try: diff --git a/schedule_viewer.py b/schedule_viewer.py index 0ac217c5..70b5ce11 100755 --- a/schedule_viewer.py +++ b/schedule_viewer.py @@ -22,7 +22,8 @@ from __future__ import print_function -import BaseHTTPServer, sys, urlparse +import BaseHTTPServer +import urlparse import bisect from gtfsscheduleviewer.marey_graph import MareyGraph import gtfsscheduleviewer @@ -32,7 +33,6 @@ import signal import json as simplejson import socket -import time import transitfeed from transitfeed import util import urllib diff --git a/shape_importer.py b/shape_importer.py index 8c12f191..f97c1435 100755 --- a/shape_importer.py +++ b/shape_importer.py @@ -22,8 +22,6 @@ __author__ = 'chris.harrelson.code@gmail.com (Chris Harrelson)' -import csv -import glob import ogr import os import shutil @@ -32,7 +30,6 @@ import transitfeed from transitfeed import shapelib from transitfeed import util -import zipfile class ShapeImporterError(Exception): diff --git a/tests/testfeedvalidator.py b/tests/testfeedvalidator.py index 9f306965..5ecb755e 100644 --- a/tests/testfeedvalidator.py +++ b/tests/testfeedvalidator.py @@ -26,8 +26,6 @@ import transitfeed from transitfeed.compat import StringIO import unittest -from urllib2 import HTTPError, URLError -import urllib2 import zipfile diff --git a/tests/transitfeed/testfeedinfo.py b/tests/transitfeed/testfeedinfo.py index e898fa5f..fbc2c63f 100644 --- a/tests/transitfeed/testfeedinfo.py +++ b/tests/transitfeed/testfeedinfo.py @@ -17,7 +17,6 @@ from datetime import date from tests import util -import transitfeed class FeedInfoTestCase(util.MemoryZipTestCase): diff --git a/transitfeed/farerule.py b/transitfeed/farerule.py index b30ad945..056d9212 100755 --- a/transitfeed/farerule.py +++ b/transitfeed/farerule.py @@ -15,7 +15,6 @@ # limitations under the License. from __future__ import absolute_import -from .problems import default_problem_reporter from .gtfsobjectbase import GtfsObjectBase class FareRule(GtfsObjectBase): diff --git a/transitfeed/problems.py b/transitfeed/problems.py index 98e507b0..6a7320e3 100755 --- a/transitfeed/problems.py +++ b/transitfeed/problems.py @@ -21,7 +21,7 @@ import time from . import util -from .errors import TYPE_ERROR, TYPE_WARNING, TYPE_NOTICE, ALL_TYPES, Error +from .errors import ALL_TYPES, TYPE_ERROR, TYPE_NOTICE, TYPE_WARNING, Error MAX_DISTANCE_FROM_STOP_TO_SHAPE = 1000 MAX_DISTANCE_BETWEEN_STOP_AND_PARENT_STATION_WARNING = 100.0 diff --git a/transitfeed/serviceperiod.py b/transitfeed/serviceperiod.py index 7098f54c..e2c1c118 100755 --- a/transitfeed/serviceperiod.py +++ b/transitfeed/serviceperiod.py @@ -16,7 +16,6 @@ from __future__ import absolute_import import datetime -import re import time from . import problems as problems_module diff --git a/transitfeed/shapelib.py b/transitfeed/shapelib.py index 5d6003bf..8747344a 100644 --- a/transitfeed/shapelib.py +++ b/transitfeed/shapelib.py @@ -32,8 +32,6 @@ __author__ = 'chris.harrelson.code@gmail.com (Chris Harrelson)' -import copy -import decimal import heapq import math diff --git a/transitfeed/shapepoint.py b/transitfeed/shapepoint.py index 867b3b5b..aa519396 100644 --- a/transitfeed/shapepoint.py +++ b/transitfeed/shapepoint.py @@ -16,11 +16,9 @@ # limitations under the License. from __future__ import absolute_import -import bisect from .gtfsobjectbase import GtfsObjectBase from . import problems as problems_module from . import util -import sys class ShapePoint(GtfsObjectBase): """This class represents a single shape point. diff --git a/transitfeed/util.py b/transitfeed/util.py index 1fea2dc8..99accf24 100644 --- a/transitfeed/util.py +++ b/transitfeed/util.py @@ -25,7 +25,6 @@ import re import socket import sys -import time import urllib2 from . import errors @@ -230,7 +229,7 @@ def _MaxVersion(versions): if len(versions) == 0: return None - version_tuple = lambda x: tuple(int(item) for item in x.split('.')) + version_tuple = lambda x: tuple(int(item) for item in x.split('.')) return max(versions, key=version_tuple) OUTPUT_ENCODING = 'utf-8' diff --git a/unusual_trip_filter.py b/unusual_trip_filter.py index c0c22101..a39161f0 100644 --- a/unusual_trip_filter.py +++ b/unusual_trip_filter.py @@ -24,11 +24,6 @@ __author__ = 'Jiri Semecky ' -import codecs -import os -import os.path -import sys -import time import transitfeed from transitfeed import util diff --git a/visualize_pathways.py b/visualize_pathways.py index 8cb93d18..3b1ff52a 100755 --- a/visualize_pathways.py +++ b/visualize_pathways.py @@ -46,7 +46,6 @@ import re import os import subprocess -import sys class LocationType(Enum):