From f4e719749abdfbbacee3acb8477272d1a66dc72c Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sat, 7 May 2016 11:26:00 -0700 Subject: [PATCH] Cleanup all imports * Should fix problems with needing to do inline imports --- PlexPy.py | 11 ++++---- data/interfaces/default/base.html | 6 ++-- data/interfaces/default/info.html | 3 +- data/interfaces/default/logs.html | 2 +- .../default/notification_config.html | 2 +- .../default/notification_triggers_modal.html | 2 +- data/interfaces/default/scheduler_table.html | 8 +++--- data/interfaces/default/settings.html | 13 +++++---- data/interfaces/default/user.html | 2 +- data/interfaces/default/welcome.html | 4 +-- plexpy/__init__.py | 10 +++++-- plexpy/activity_handler.py | 10 +++++-- plexpy/activity_pinger.py | 15 ++++++++-- plexpy/activity_processor.py | 17 +++++++---- plexpy/api.py | 21 ++++++++++---- plexpy/api2.py | 8 +++++- plexpy/common.py | 2 +- plexpy/config.py | 25 ++++++++++++++--- plexpy/database.py | 3 +- plexpy/datafactory.py | 10 +++++-- plexpy/datatables.py | 7 +++-- plexpy/graphs.py | 10 +++++-- plexpy/helpers.py | 13 ++------- plexpy/http_handler.py | 5 +++- plexpy/libraries.py | 28 +++++++++---------- plexpy/log_reader.py | 6 ++-- plexpy/logger.py | 16 +++++------ plexpy/notification_handler.py | 14 +++++++--- plexpy/notifiers.py | 5 +++- plexpy/plextv.py | 8 +++++- plexpy/plexwatch_import.py | 12 +++++--- plexpy/pmsconnect.py | 16 ++++++----- plexpy/request.py | 11 ++++---- plexpy/session.py | 6 ++-- plexpy/users.py | 11 ++++++-- plexpy/versioncheck.py | 10 ++++--- plexpy/web_socket.py | 13 +++++---- plexpy/webauth.py | 8 ++++-- plexpy/webserve.py | 22 ++++++++++++--- plexpy/webstart.py | 6 ++-- 40 files changed, 256 insertions(+), 145 deletions(-) diff --git a/PlexPy.py b/PlexPy.py index b601fcee..e57cc8f7 100755 --- a/PlexPy.py +++ b/PlexPy.py @@ -27,13 +27,14 @@ import sys # Ensure lib added to path, before any other imports sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'lib/')) -from plexpy import webstart, logger, web_socket - -import locale -import time -import signal import argparse +import locale +import signal +import time + import plexpy +from plexpy import logger, web_socket, webstart + # Register signals, such as CTRL + C signal.signal(signal.SIGINT, plexpy.sig_handler) diff --git a/data/interfaces/default/base.html b/data/interfaces/default/base.html index 9b1c027d..79599e72 100644 --- a/data/interfaces/default/base.html +++ b/data/interfaces/default/base.html @@ -1,7 +1,7 @@ <% -import plexpy -from plexpy import version -from plexpy.helpers import anon_url + import plexpy + from plexpy import version + from plexpy.helpers import anon_url %> diff --git a/data/interfaces/default/info.html b/data/interfaces/default/info.html index 139b1915..1829e246 100644 --- a/data/interfaces/default/info.html +++ b/data/interfaces/default/info.html @@ -36,9 +36,10 @@ DOCUMENTATION :: END <%! - from plexpy import common import re + from plexpy import common + # Get audio codec file def af(codec): for pattern, file in common.MEDIA_FLAGS_AUDIO.iteritems(): diff --git a/data/interfaces/default/logs.html b/data/interfaces/default/logs.html index d9304bbf..4b8e6084 100644 --- a/data/interfaces/default/logs.html +++ b/data/interfaces/default/logs.html @@ -1,6 +1,6 @@ <%inherit file="base.html"/> <%! -from plexpy import helpers + from plexpy import helpers %> <%def name="headIncludes()"> diff --git a/data/interfaces/default/notification_config.html b/data/interfaces/default/notification_config.html index 361d2848..c1950d76 100644 --- a/data/interfaces/default/notification_config.html +++ b/data/interfaces/default/notification_config.html @@ -1,5 +1,5 @@ <%! -from plexpy import helpers + from plexpy import helpers %> % if data: