Import cleanup

This commit is contained in:
itdominator 2023-01-29 00:06:52 -06:00
parent bd6076b4e7
commit b8306a9c4d
12 changed files with 25 additions and 16 deletions

View File

@ -1,5 +1,8 @@
# Python imports
import os, threading, subprocess, time
import os
import threading
import subprocess
import time
# Lib imports
import gi
@ -10,6 +13,8 @@ from gi.repository import Gtk
from plugins.plugin_base import PluginBase
# NOTE: Threads WILL NOT die with parent's destruction.
def threaded(fn):
def wrapper(*args, **kwargs):

View File

@ -1,8 +1,6 @@
import builtins
import threading
# Python imports
import builtins
import threading
# Lib imports
@ -14,6 +12,7 @@ from utils.settings import Settings
# NOTE: Threads WILL NOT die with parent's destruction.
def threaded_wrapper(fn):
def wrapper(*args, **kwargs):

View File

@ -9,7 +9,6 @@ from setproctitle import setproctitle
import tracemalloc
tracemalloc.start()
# Lib imports
import gi
gi.require_version('Gtk', '3.0')
@ -20,6 +19,8 @@ from __builtins__ import *
from app import Application
if __name__ == "__main__":
''' Set process title, get arguments, and create GTK main thread. '''

View File

@ -10,6 +10,7 @@ from core.window import Window
class AppLaunchException(Exception):
...

View File

@ -1,12 +1,10 @@
# Python imports
import subprocess
# Gtk imports
# Lib imports
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GLib
@ -18,6 +16,7 @@ from .core_widget import CoreWidget
class Controller(DummyMixin, ControllerData):
def __init__(self, args, unknownargs):
self._setup_styling()

View File

@ -8,6 +8,7 @@ from plugins.plugins_controller import PluginsController
class ControllerData:
''' ControllerData contains most of the state of the app at ay given time. It also has some support methods. '''

View File

@ -1,15 +1,15 @@
# Python imports
# Gtk imports
# Lib imports
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
# Application imports
class CoreWidget(Gtk.Box):
def __init__(self):
super(CoreWidget, self).__init__()

View File

@ -5,10 +5,8 @@ import signal
# Lib imports
import gi
import cairo
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GLib

View File

@ -1,7 +1,7 @@
# Python imports
import os
import threading
import ime
import time
from multiprocessing.connection import Client
from multiprocessing.connection import Listener

View File

@ -1,7 +1,7 @@
# Python imports
import re
# Gtk imports
# Lib imports
import gi
gi.require_version('Gdk', '3.0')
from gi.repository import Gdk
@ -10,6 +10,7 @@ from gi.repository import Gdk
def err(log = ""):
"""Print an error message"""
print(log)

View File

@ -2,9 +2,13 @@
import os
import logging
# Lib imports
# Application imports
class Logger:
"""
Create a new logging object and return it.

View File

@ -3,7 +3,7 @@ import os
import json
import inspect
# Gtk imports
# Lib imports
# Application imports
from .logger import Logger