From 35e51453733874e7954b22cb4a81c1d93374623e Mon Sep 17 00:00:00 2001 From: Peter Foley Date: Sat, 16 Jan 2016 23:31:07 -0500 Subject: [PATCH] imports --- cslbot/alembic/env.py | 2 ++ cslbot/alembic/script.py.mako | 1 + cslbot/alembic/versions/3614b38ddf9_kick_logging_change.py | 3 ++- cslbot/alembic/versions/385c29e42d9_remove_nicks.py | 3 ++- cslbot/alembic/versions/4d165186b4ed_fix_nullable.py | 1 + cslbot/alembic/versions/7fde00129eb6_multi_babble.py | 3 ++- cslbot/commands/cve.py | 1 + cslbot/commands/define.py | 1 + cslbot/commands/fml.py | 1 + cslbot/commands/fweather.py | 1 + cslbot/commands/imdb.py | 1 + cslbot/commands/man.py | 1 + cslbot/commands/tjbash.py | 1 + cslbot/commands/weather.py | 2 ++ cslbot/commands/wikipath.py | 1 + cslbot/commands/wolf.py | 1 + cslbot/helpers/arguments.py | 1 + cslbot/helpers/orm.py | 2 ++ cslbot/helpers/textutils.py | 2 ++ cslbot/helpers/urlutils.py | 1 + cslbot/helpers/web.py | 2 ++ cslbot/helpers/workers.py | 5 +++-- scripts/parsedata.py | 3 ++- 23 files changed, 34 insertions(+), 6 deletions(-) diff --git a/cslbot/alembic/env.py b/cslbot/alembic/env.py index bbd73e2ab..9c1a2abd7 100644 --- a/cslbot/alembic/env.py +++ b/cslbot/alembic/env.py @@ -14,12 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + import configparser import logging from os.path import dirname, exists, join from sys import path from alembic import context + from sqlalchemy import create_engine # Make this work from git. diff --git a/cslbot/alembic/script.py.mako b/cslbot/alembic/script.py.mako index 95decea58..4cfe7d156 100644 --- a/cslbot/alembic/script.py.mako +++ b/cslbot/alembic/script.py.mako @@ -7,6 +7,7 @@ Create Date: ${create_date} """ from alembic import op + import sqlalchemy as sa ${imports if imports else ""} diff --git a/cslbot/alembic/versions/3614b38ddf9_kick_logging_change.py b/cslbot/alembic/versions/3614b38ddf9_kick_logging_change.py index 5c824cbe3..f821e4cf3 100644 --- a/cslbot/alembic/versions/3614b38ddf9_kick_logging_change.py +++ b/cslbot/alembic/versions/3614b38ddf9_kick_logging_change.py @@ -7,9 +7,10 @@ """ -import sqlalchemy as sa from alembic import op +import sqlalchemy as sa + # revision identifiers, used by Alembic. revision = '3614b38ddf9' down_revision = 'ef7ccebeff' diff --git a/cslbot/alembic/versions/385c29e42d9_remove_nicks.py b/cslbot/alembic/versions/385c29e42d9_remove_nicks.py index f993f33ee..e1d5ff7dd 100644 --- a/cslbot/alembic/versions/385c29e42d9_remove_nicks.py +++ b/cslbot/alembic/versions/385c29e42d9_remove_nicks.py @@ -7,9 +7,10 @@ """ -import sqlalchemy as sa from alembic import op +import sqlalchemy as sa + # revision identifiers, used by Alembic. revision = '385c29e42d9' down_revision = '3614b38ddf9' diff --git a/cslbot/alembic/versions/4d165186b4ed_fix_nullable.py b/cslbot/alembic/versions/4d165186b4ed_fix_nullable.py index d2d0064e5..f4aa070b0 100644 --- a/cslbot/alembic/versions/4d165186b4ed_fix_nullable.py +++ b/cslbot/alembic/versions/4d165186b4ed_fix_nullable.py @@ -8,6 +8,7 @@ """ from alembic import op + import sqlalchemy as sa diff --git a/cslbot/alembic/versions/7fde00129eb6_multi_babble.py b/cslbot/alembic/versions/7fde00129eb6_multi_babble.py index 89064ff4b..082f294d0 100644 --- a/cslbot/alembic/versions/7fde00129eb6_multi_babble.py +++ b/cslbot/alembic/versions/7fde00129eb6_multi_babble.py @@ -7,9 +7,10 @@ """ -import sqlalchemy as sa from alembic import op +import sqlalchemy as sa + # revision identifiers, used by Alembic. revision = '7fde00129eb6' down_revision = '55efdbb748c' diff --git a/cslbot/commands/cve.py b/cslbot/commands/cve.py index 0fd2b8e59..8cbda2840 100644 --- a/cslbot/commands/cve.py +++ b/cslbot/commands/cve.py @@ -18,6 +18,7 @@ import re from lxml.html import fromstring + from requests import get from ..helpers.command import Command diff --git a/cslbot/commands/define.py b/cslbot/commands/define.py index 0eeeb820e..f8124c412 100644 --- a/cslbot/commands/define.py +++ b/cslbot/commands/define.py @@ -19,6 +19,7 @@ import re from lxml import etree + from requests import get from ..helpers import arguments, textutils diff --git a/cslbot/commands/fml.py b/cslbot/commands/fml.py index 3064464ef..f0726a8ba 100644 --- a/cslbot/commands/fml.py +++ b/cslbot/commands/fml.py @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from lxml.etree import fromstring + from requests import get from ..helpers.command import Command diff --git a/cslbot/commands/fweather.py b/cslbot/commands/fweather.py index 6d8b397d8..88a921729 100644 --- a/cslbot/commands/fweather.py +++ b/cslbot/commands/fweather.py @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from lxml.html import fromstring + from requests import get from ..helpers.command import Command diff --git a/cslbot/commands/imdb.py b/cslbot/commands/imdb.py index b6f539141..49feddec8 100644 --- a/cslbot/commands/imdb.py +++ b/cslbot/commands/imdb.py @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from lxml.html import fromstring + from requests import get from ..helpers.command import Command diff --git a/cslbot/commands/man.py b/cslbot/commands/man.py index b9bd585ec..b51c57b5c 100644 --- a/cslbot/commands/man.py +++ b/cslbot/commands/man.py @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from lxml.html import fromstring + from requests import get from ..helpers import arguments diff --git a/cslbot/commands/tjbash.py b/cslbot/commands/tjbash.py index dd60cfd20..d82d5ad16 100644 --- a/cslbot/commands/tjbash.py +++ b/cslbot/commands/tjbash.py @@ -19,6 +19,7 @@ from random import choice from lxml.html import fromstring + from requests import get from ..helpers.command import Command diff --git a/cslbot/commands/weather.py b/cslbot/commands/weather.py index 0a3e96e1f..ffe92fecc 100644 --- a/cslbot/commands/weather.py +++ b/cslbot/commands/weather.py @@ -21,7 +21,9 @@ from os.path import join import geoip2 + from pkg_resources import Requirement, resource_filename + from requests import get from ..helpers import arguments diff --git a/cslbot/commands/wikipath.py b/cslbot/commands/wikipath.py index a7d082f3b..f753d7ff2 100644 --- a/cslbot/commands/wikipath.py +++ b/cslbot/commands/wikipath.py @@ -18,6 +18,7 @@ from datetime import datetime from lxml.html import fromstring + from requests import get from ..helpers import arguments diff --git a/cslbot/commands/wolf.py b/cslbot/commands/wolf.py index c1a3e3369..e2d17f207 100644 --- a/cslbot/commands/wolf.py +++ b/cslbot/commands/wolf.py @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from lxml.etree import fromstring + from requests import get from ..helpers.command import Command diff --git a/cslbot/helpers/arguments.py b/cslbot/helpers/arguments.py index 7e9366b57..9ebb74ef7 100644 --- a/cslbot/helpers/arguments.py +++ b/cslbot/helpers/arguments.py @@ -19,6 +19,7 @@ import re import dateutil.parser + from requests import get diff --git a/cslbot/helpers/orm.py b/cslbot/helpers/orm.py index f00875cc5..86e6da01e 100644 --- a/cslbot/helpers/orm.py +++ b/cslbot/helpers/orm.py @@ -18,7 +18,9 @@ # USA. from alembic import command, config + from pkg_resources import Requirement, resource_filename + from sqlalchemy import Column, DateTime, ForeignKey, Integer, Unicode, UnicodeText from sqlalchemy.ext.declarative import as_declarative, declared_attr diff --git a/cslbot/helpers/textutils.py b/cslbot/helpers/textutils.py index 3c061e2a1..0f7548ece 100644 --- a/cslbot/helpers/textutils.py +++ b/cslbot/helpers/textutils.py @@ -24,7 +24,9 @@ from random import choice, randint, random, randrange from lxml import etree, html + from pkg_resources import Requirement, resource_string + from requests import get, post from .tokens import token_cache diff --git a/cslbot/helpers/urlutils.py b/cslbot/helpers/urlutils.py index 690d67e93..20eea728e 100644 --- a/cslbot/helpers/urlutils.py +++ b/cslbot/helpers/urlutils.py @@ -24,6 +24,7 @@ from urllib.request import Request, urlopen from lxml.html import parse + from requests import post from requests.exceptions import ConnectTimeout diff --git a/cslbot/helpers/web.py b/cslbot/helpers/web.py index 20fd95db8..44bdace84 100644 --- a/cslbot/helpers/web.py +++ b/cslbot/helpers/web.py @@ -23,7 +23,9 @@ from requests import get, post from requests.exceptions import ReadTimeout + from requests_oauthlib import OAuth1Session + from simplejson import JSONDecodeError from . import urlutils diff --git a/cslbot/helpers/workers.py b/cslbot/helpers/workers.py index 15418fd18..c28752172 100644 --- a/cslbot/helpers/workers.py +++ b/cslbot/helpers/workers.py @@ -15,14 +15,15 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import concurrent.futures import multiprocessing import re import signal import threading -from datetime import datetime, timedelta from collections import namedtuple +from datetime import datetime, timedelta + +import concurrent.futures from sqlalchemy import or_ diff --git a/scripts/parsedata.py b/scripts/parsedata.py index da81060dc..c547b05a3 100755 --- a/scripts/parsedata.py +++ b/scripts/parsedata.py @@ -22,10 +22,11 @@ import shutil import sys from datetime import datetime, timedelta -from time import strftime from os import makedirs, path +from time import strftime from jinja2 import Environment, FileSystemLoader + from pkg_resources import Requirement, resource_filename # Make this work from git.