Skip to content

Commit

Permalink
Removed unused imports from files (#3906)
Browse files Browse the repository at this point in the history
* removed unused imports 1

* batch2

* branch3

* batch4

* batch5

* batch6

* batch 7/8/9/10

* batch11

* batch12

* batch13

Co-authored-by: Christian Clauss <cclauss@me.com>
  • Loading branch information
2 people authored and mekarpeles committed Oct 26, 2020
1 parent 0d6a26b commit d95bc3e
Show file tree
Hide file tree
Showing 18 changed files with 10 additions and 27 deletions.
4 changes: 1 addition & 3 deletions openlibrary/catalog/amazon/crawl.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import print_function
from lxml.html import parse, tostring, fromstring
from lxml.html import fromstring
import re
import sys
import os
Expand All @@ -8,8 +8,6 @@
from os.path import exists
from datetime import date, timedelta, datetime

from six.moves.urllib.parse import unquote
from six.moves.urllib.request import urlopen


# scrap Amazon for book and author data
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/catalog/amazon/crawl_top_books.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import print_function
from openlibrary.catalog.amazon.crawl import read_page, write_books, get_url, get_cats
from openlibrary.catalog.amazon.crawl import read_page, get_url, get_cats

def get_serp():
params = 'i:stripbooks,n:!1000,p_n_feature_browse-bin:618083011'
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/catalog/amazon/list_done.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import print_function
from lxml.html import fromstring, tostring
from lxml.html import fromstring
from openlibrary.catalog.utils.arc import read_arc, read_body
import re
import os
Expand Down
1 change: 0 additions & 1 deletion openlibrary/catalog/amazon/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import re
import os
import sys
import web
from warnings import warn
from math import floor
from pprint import pprint
Expand Down
1 change: 0 additions & 1 deletion openlibrary/catalog/marc/lang.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from catalog.infostore import get_site
import web

site = get_site()
lang = set(site.things({'type': '/type/language'}))
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/catalog/marc/marc_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unicodedata import normalize

from openlibrary.catalog.marc import mnemonics
from openlibrary.catalog.marc.marc_base import MarcBase, MarcException, BadMARC, re_isbn
from openlibrary.catalog.marc.marc_base import MarcBase, MarcException, BadMARC


import six
Expand Down
4 changes: 2 additions & 2 deletions openlibrary/catalog/marc/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from openlibrary.catalog.marc.get_subjects import subjects_for_work
from openlibrary.catalog.marc.marc_base import BadMARC, NoTitle, MarcException
from openlibrary.catalog.utils import (
pick_first_date, tidy_isbn, flip_name,
remove_trailing_dot, remove_trailing_number_dot)
pick_first_date, remove_trailing_dot, remove_trailing_number_dot, tidy_isbn
)

re_bad_char = re.compile(u'\ufffd')
re_question = re.compile(r'^\?+$')
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/catalog/marc/tests/test_get_subjects.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from openlibrary.catalog.marc.marc_xml import MarcXml, BadSubtag, BlankTag
from openlibrary.catalog.marc.marc_xml import MarcXml
from openlibrary.catalog.marc.marc_binary import MarcBinary
from openlibrary.catalog.marc.get_subjects import (
four_types, read_subjects)
Expand Down
2 changes: 0 additions & 2 deletions openlibrary/catalog/marc/tests/test_marc_html.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pytest

from openlibrary.catalog.marc.html import html_record


Expand Down
1 change: 0 additions & 1 deletion openlibrary/catalog/merge/merge_marc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import re

from openlibrary.catalog.merge.names import match_name
from openlibrary.catalog.merge.normalize import normalize

# fields needed for merge process:
Expand Down
5 changes: 1 addition & 4 deletions openlibrary/catalog/merge/test_amazon.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
"""

import pytest
from openlibrary.catalog.merge.amazon import (
attempt_merge,
compare_authors, compare_publisher,
full_title, build_titles, compare_title)
from openlibrary.catalog.merge.amazon import attempt_merge

pytestmark = pytest.mark.skip('Skip Legacy Amazon record matching tests.')

Expand Down
1 change: 0 additions & 1 deletion openlibrary/catalog/merge/test_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from openlibrary.catalog.merge.merge import (
attempt_merge,
compare_authors, compare_publisher,
full_title, build_titles, compare_title)

""" These tests seem to be duplicates of those in test_amazon.py,
Expand Down
1 change: 0 additions & 1 deletion openlibrary/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import requests
import web
from infogami import config
from infogami.utils import stats

from openlibrary.core import cache

Expand Down
1 change: 0 additions & 1 deletion openlibrary/core/civicrm.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json
import requests

from infogami import config
from openlibrary.core import lending

CIVI_ISBN = 'custom_52'
Expand Down
1 change: 0 additions & 1 deletion openlibrary/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from infogami.utils.view import safeint

# TODO: i18n should be moved to core or infogami
from openlibrary.i18n import gettext as _

__all__ = [
"sanitize",
Expand Down
3 changes: 1 addition & 2 deletions openlibrary/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
#TODO: fix this. openlibrary.core should not import plugins.
from openlibrary import accounts
from openlibrary.utils import extract_numeric_id_from_olid
from openlibrary.plugins.upstream.utils import get_history
from openlibrary.core.helpers import private_collection_in
from openlibrary.core.bookshelves import Bookshelves
from openlibrary.core.ratings import Ratings
from openlibrary.utils.isbn import to_isbn_13, isbn_13_to_isbn_10, canonical
from openlibrary.core.vendors import create_edition_from_amazon_metadata

from openlibrary.core.lists.model import ListMixin, Seed
from openlibrary.core.lists.model import ListMixin
from . import cache, waitinglist

from six.moves import urllib
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/core/vendors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from paapi5_python_sdk.rest import ApiException

from infogami.utils.view import public
from openlibrary.core import lending, cache, helpers as h
from openlibrary.core import cache, helpers as h
from openlibrary.utils import dateutil
from openlibrary.utils.isbn import (
normalize_isbn, isbn_13_to_isbn_10, isbn_10_to_isbn_13)
Expand Down
2 changes: 0 additions & 2 deletions openlibrary/core/waitinglist.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
import datetime
import logging
import web
from infogami import config
from openlibrary.accounts.model import OpenLibraryAccount
from . import helpers as h
from .sendmail import sendmail_with_template
from . import db
from . import lending

from six.moves import urllib

logger = logging.getLogger("openlibrary.waitinglist")

Expand Down

0 comments on commit d95bc3e

Please sign in to comment.