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
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import ctypes
import datetime
import os

View file

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

View file

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

View file

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

View file

@ -15,8 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
from hashing_passwords import check_hash
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
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
import distro
import platform
from collections import OrderedDict
import plexpy
from plexpy import version

View file

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

View file

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

View file

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

View file

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

View file

@ -14,7 +14,6 @@
# along with Tautulli. If not, see <http://www.gnu.org/licenses/>.
class PlexPyException(Exception):
"""
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/>.
import csv
import json
import os
import requests

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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