Import cleanup

This commit is contained in:
itdominator 2023-01-28 23:54:23 -06:00
parent dcaa5ce626
commit 9ae0182928
11 changed files with 35 additions and 29 deletions

View File

@ -1,5 +1,5 @@
# Python imports # Python imports
import threading, json import json
from os import path from os import path
# Lib imports # Lib imports
@ -8,10 +8,6 @@ from os import path
from .window import Window from .window import Window
def threaded(fn):
def wrapper(*args, **kwargs):
threading.Thread(target=fn, args=args, kwargs=kwargs, daemon=True).start()
return wrapper
class WindowController: class WindowController:

View File

@ -1,4 +1,4 @@
# Python Imports # Python imports
import hashlib import hashlib
from os.path import isfile from os.path import isfile
@ -21,6 +21,7 @@ from .mixins.desktopiconmixin import DesktopIconMixin
class Icon(DesktopIconMixin, VideoIconMixin, MeshsIconMixin): class Icon(DesktopIconMixin, VideoIconMixin, MeshsIconMixin):
def create_icon(self, dir, file): def create_icon(self, dir, file):
full_path = f"{dir}/{file}" full_path = f"{dir}/{file}"

View File

@ -1,8 +1,10 @@
# Python Imports # Python imports
import os, subprocess, hashlib import os
from os.path import isfile from os.path import isfile
import subprocess
import hashlib
# Gtk imports # Lib imports
import gi import gi
gi.require_version('Gtk', '3.0') gi.require_version('Gtk', '3.0')
@ -13,6 +15,8 @@ from gi.repository import Gio
from .xdg.DesktopEntry import DesktopEntry from .xdg.DesktopEntry import DesktopEntry
class DesktopIconMixin: class DesktopIconMixin:
def parse_desktop_files(self, full_path): def parse_desktop_files(self, full_path):
try: try:

View File

@ -1,4 +1,4 @@
# Python Imports # Python imports
import subprocess import subprocess
# Lib imports # Lib imports
@ -6,6 +6,8 @@ import subprocess
# Application imports # Application imports
class MeshsIconMixin: class MeshsIconMixin:
def generate_blender_thumbnail(self, full_path, hash_img_path): def generate_blender_thumbnail(self, full_path, hash_img_path):
try: try:

View File

@ -1,4 +1,4 @@
# Python Imports # Python imports
import subprocess import subprocess
# Lib imports # Lib imports
@ -6,6 +6,8 @@ import subprocess
# Application imports # Application imports
class VideoIconMixin: class VideoIconMixin:
def generate_video_thumbnail(self, full_path, hash_img_path, scrub_percent = "65%"): def generate_video_thumbnail(self, full_path, hash_img_path, scrub_percent = "65%"):
try: try:

View File

@ -6,6 +6,8 @@ import os
# Application imports # Application imports
class Path: class Path:
def get_home(self) -> str: def get_home(self) -> str:
return os.path.expanduser("~") + self.subpath return os.path.expanduser("~") + self.subpath

View File

@ -1,23 +1,24 @@
# Python imports # Python imports
import hashlib, re import hashlib
import re
from os import listdir from os import listdir
from os.path import isdir, isfile, join from os.path import isdir
from os.path import isfile
from os.path import join
from random import randint from random import randint
# Lib imports # Lib imports
# Application imports # Application imports
from .utils.settings import Settings from .utils.settings import Settings
from .utils.launcher import Launcher from .utils.launcher import Launcher
from .utils.filehandler import FileHandler from .utils.filehandler import FileHandler
from .icons.icon import Icon from .icons.icon import Icon
from .path import Path from .path import Path
class Tab(Settings, FileHandler, Launcher, Icon, Path): class Tab(Settings, FileHandler, Launcher, Icon, Path):
def __init__(self): def __init__(self):
self.logger = None self.logger = None

View File

@ -1,5 +1,6 @@
# Python imports # Python imports
import os, shutil import os
import shutil
# Lib imports # Lib imports

View File

@ -1,16 +1,13 @@
# System import # Python imports
import os, threading, subprocess, shlex import os,
import subprocess
import shlex
# Lib imports # Lib imports
# Apoplication imports # Apoplication imports
def threaded(fn):
def wrapper(*args, **kwargs):
threading.Thread(target=fn, args=args, kwargs=kwargs).start()
return wrapper
class Launcher: class Launcher:

View File

@ -1,15 +1,15 @@
# System import # Python imports
import json import json
import os import os
from os import path from os import path
# Lib imports # Lib imports
# Apoplication imports # Apoplication imports
class Settings: class Settings:
logger = None logger = None

View File

@ -1,14 +1,14 @@
# Python imports # Python imports
from random import randint from random import randint
# Lib imports # Lib imports
# Application imports # Application imports
from .tabs.tab import Tab from .tabs.tab import Tab
class Window: class Window:
def __init__(self): def __init__(self):
self._id_length: int = 10 self._id_length: int = 10