Clean up imports and blank lines

This commit is contained in:
JonnyWong16 2024-05-09 22:16:00 -07:00
commit 40ba225268
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
38 changed files with 24 additions and 137 deletions

View file

@ -13,7 +13,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import ctypes import ctypes
import datetime import datetime
import os import os

View file

@ -13,7 +13,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import datetime import datetime
import os import os
import time import time

View file

@ -13,7 +13,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import threading import threading
import plexpy import plexpy
@ -21,7 +20,6 @@ from plexpy import activity_handler
from plexpy import activity_processor from plexpy import activity_processor
from plexpy import database from plexpy import database
from plexpy import helpers from plexpy import helpers
from plexpy import libraries
from plexpy import logger from plexpy import logger
from plexpy import notification_handler from plexpy import notification_handler
from plexpy import plextv from plexpy import plextv

View file

@ -13,7 +13,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
from collections import defaultdict from collections import defaultdict
import json import json

View file

@ -15,8 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
from hashing_passwords import check_hash from hashing_passwords import check_hash
from io import open from io import open

View file

@ -1,71 +0,0 @@
# -*- coding: utf-8 -*-
# This file is part of Tautulli.
#
# Tautulli is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Tautulli is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
#########################################
## Stolen from Sick-Beard's classes.py ##
#########################################
from urllib.request import FancyURLopener
import plexpy
from plexpy.common import USER_AGENT
class PlexPyURLopener(FancyURLopener):
version = USER_AGENT
class AuthURLOpener(PlexPyURLopener):
"""
URLOpener class that supports http auth without needing interactive password entry.
If the provided username/password don't work it simply fails.
user: username to use for HTTP auth
pw: password to use for HTTP auth
"""
def __init__(self, user, pw):
self.username = user
self.password = pw
# remember if we've tried the username/password before
self.numTries = 0
# call the base class
FancyURLopener.__init__(self)
def prompt_user_passwd(self, host, realm):
"""
Override this function and instead of prompting just give the
username/password that were provided when the class was instantiated.
"""
# if this is the first try then provide a username/password
if self.numTries == 0:
self.numTries = 1
return (self.username, self.password)
# if we've tried before then return blank which cancels the request
else:
return ('', '')
# this is pretty much just a hack for convenience
def openit(self, url):
self.numTries = 0
return PlexPyURLopener.open(self, url)

View file

@ -15,12 +15,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import distro import distro
import platform import platform
from collections import OrderedDict from collections import OrderedDict
import plexpy
from plexpy import version from plexpy import version

View file

@ -13,7 +13,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import os import os
import re import re
import shutil import shutil

View file

@ -13,7 +13,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import os import os
import sqlite3 import sqlite3
import shutil import shutil

View file

@ -15,11 +15,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import json import json
import plexpy import plexpy
from plexpy import libraries
from plexpy import common from plexpy import common
from plexpy import database from plexpy import database
from plexpy import datatables from plexpy import datatables

View file

@ -13,7 +13,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import re import re
import plexpy import plexpy

View file

@ -14,7 +14,6 @@
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
class PlexPyException(Exception): class PlexPyException(Exception):
""" """
Generic Tautulli Exception - should never be thrown, only subclassed Generic Tautulli Exception - should never be thrown, only subclassed

View file

@ -16,7 +16,6 @@
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import csv import csv
import json import json
import os import os
import requests import requests

View file

@ -15,9 +15,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import datetime
import arrow import arrow
import datetime
import plexpy import plexpy
from plexpy import common from plexpy import common
from plexpy import database from plexpy import database

View file

@ -15,8 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import arrow import arrow
import base64 import base64
import cloudinary import cloudinary

View file

@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with PlexPy. If not, see <http://www.gnu.org/licenses/>. # along with PlexPy. If not, see <http://www.gnu.org/licenses/>.
from multiprocessing.dummy import Pool as ThreadPool from multiprocessing.dummy import Pool as ThreadPool
from urllib.parse import urljoin from urllib.parse import urljoin

View file

@ -15,10 +15,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import json import json
import os import os
from datetime import datetime, timedelta
import plexpy import plexpy
from plexpy import common from plexpy import common

View file

@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import queue import queue
import time import time
import threading import threading

View file

@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
from logging import handlers from logging import handlers
import cherrypy import cherrypy

View file

@ -15,11 +15,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import requests import requests
import threading import threading
import plexpy
from plexpy import database from plexpy import database
from plexpy import helpers from plexpy import helpers
from plexpy import logger from plexpy import logger

View file

@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
from io import open from io import open
import os import os

View file

@ -15,16 +15,16 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import arrow
from collections import OrderedDict from collections import OrderedDict
import json import json
from itertools import groupby from itertools import groupby
from mako.lookup import TemplateLookup
from mako import exceptions
import os import os
import re import re
import arrow
from mako.lookup import TemplateLookup
from mako import exceptions
import plexpy import plexpy
from plexpy import common from plexpy import common
from plexpy import database from plexpy import database

View file

@ -15,10 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
from typing import Optional
import arrow
import bleach import bleach
from collections import Counter, defaultdict from collections import Counter, defaultdict
from functools import partial from functools import partial
@ -30,7 +26,9 @@ import os
import re import re
from string import Formatter from string import Formatter
import threading import threading
from typing import Optional
import arrow
import musicbrainzngs import musicbrainzngs
import plexpy import plexpy

View file

@ -15,20 +15,14 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import base64 import base64
import bleach
from collections import defaultdict from collections import defaultdict
import json
from email.mime.multipart import MIMEMultipart from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText from email.mime.text import MIMEText
import email.utils import email.utils
import paho.mqtt.client import json
import paho.mqtt.publish
import os import os
import re import re
import requests
from requests.auth import HTTPBasicAuth
import smtplib import smtplib
import subprocess import subprocess
import sys import sys
@ -37,6 +31,12 @@ import time
from urllib.parse import urlencode from urllib.parse import urlencode
from urllib.parse import urlparse from urllib.parse import urlparse
import bleach
import paho.mqtt.client
import paho.mqtt.publish
import requests
from requests.auth import HTTPBasicAuth
try: try:
from Cryptodome.Protocol.KDF import PBKDF2 from Cryptodome.Protocol.KDF import PBKDF2
from Cryptodome.Cipher import AES from Cryptodome.Cipher import AES

View file

@ -15,10 +15,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import plexpy import plexpy
from plexpy import logger
class DummyObject(object): class DummyObject(object):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):

View file

@ -15,12 +15,11 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import arrow
import sqlite3 import sqlite3
from xml.dom import minidom from xml.dom import minidom
import plexpy import arrow
from plexpy import activity_processor from plexpy import activity_processor
from plexpy import database from plexpy import database
from plexpy import helpers from plexpy import helpers

View file

@ -15,9 +15,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
from urllib.parse import unquote
import json import json
from urllib.parse import unquote
import plexpy import plexpy
from plexpy import common from plexpy import common

View file

@ -15,11 +15,9 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import sqlite3 import sqlite3
from xml.dom import minidom from xml.dom import minidom
import plexpy
from plexpy import activity_processor from plexpy import activity_processor
from plexpy import database from plexpy import database
from plexpy import helpers from plexpy import helpers

View file

@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import json import json
import os import os
import time import time

View file

@ -15,11 +15,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import collections
from bs4 import BeautifulSoup
from xml.dom import minidom from xml.dom import minidom
import collections from bs4 import BeautifulSoup
import requests import requests
from requests.packages import urllib3 from requests.packages import urllib3

View file

@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import cherrypy import cherrypy
import plexpy import plexpy

View file

@ -19,7 +19,6 @@ from urllib.parse import parse_qsl
import arrow import arrow
import httpagentparser import httpagentparser
from datetime import datetime, timedelta
import plexpy import plexpy
from plexpy import common from plexpy import common

View file

@ -15,6 +15,5 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
PLEXPY_BRANCH = "beta" PLEXPY_BRANCH = "beta"
PLEXPY_RELEASE_VERSION = "v2.14.0-beta" PLEXPY_RELEASE_VERSION = "v2.14.0-beta"

View file

@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import json import json
import os import os
import platform import platform

View file

@ -17,7 +17,6 @@
# Mostly borrowed from https://github.com/trakt/Plex-Trakt-Scrobbler # Mostly borrowed from https://github.com/trakt/Plex-Trakt-Scrobbler
import json import json
import ssl import ssl
import threading import threading

View file

@ -20,7 +20,6 @@
# Form based authentication for CherryPy. Requires the # Form based authentication for CherryPy. Requires the
# Session tool to be loaded. # Session tool to be loaded.
from datetime import datetime, timedelta, timezone from datetime import datetime, timedelta, timezone
from urllib.parse import quote, unquote from urllib.parse import quote, unquote

View file

@ -15,15 +15,14 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>. # along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import csv
from io import open, BytesIO
import base64 import base64
import csv
from io import open, BytesIO
import json import json
import ssl as _ssl
import linecache import linecache
import os import os
import shutil import shutil
import ssl as _ssl
import sys import sys
import threading import threading
import zipfile import zipfile

View file

@ -17,6 +17,7 @@
import os import os
import sys import sys
from infi.systray import SysTrayIcon from infi.systray import SysTrayIcon
try: try: