small cleanups

This commit is contained in:
itdominator 2021-11-27 01:59:20 -06:00
parent c16da39330
commit e6fe296b92
4 changed files with 5 additions and 10 deletions

View File

@ -17,7 +17,7 @@ def threaded(fn):
class WindowController: class WindowController:
def __init__(self): def __init__(self):
USER_HOME = path.expanduser('~') USER_HOME = path.expanduser('~')
CONFIG_PATH = USER_HOME + "/.config/pyfm" CONFIG_PATH = USER_HOME + "/.config/pyfm"
self.session_file = CONFIG_PATH + "/session.json" self.session_file = CONFIG_PATH + "/session.json"
self._event_sleep_time = 1 self._event_sleep_time = 1

View File

@ -18,7 +18,7 @@ from . import Path
class View(Settings, FileHandler, Launcher, Icon, Path): class View(Settings, FileHandler, Launcher, Icon, Path):
def __init__(self): def __init__(self):
self. logger = None self. logger = None
self.id_length = 10 self.id_length = 10
self.id = "" self.id = ""

View File

@ -3,17 +3,12 @@ import os, subprocess, threading, hashlib
from os.path import isfile from os.path import isfile
# Gtk imports # Gtk imports
import gi
gi.require_version('Gtk', '3.0')
# from gi.repository import Gtk
from gi.repository import GdkPixbuf from gi.repository import GdkPixbuf
# Application imports # Application imports
from .mixins import * from .mixins import *
def threaded(fn): def threaded(fn):
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
threading.Thread(target=fn, args=args, kwargs=kwargs).start() threading.Thread(target=fn, args=args, kwargs=kwargs).start()
@ -61,9 +56,9 @@ class Icon(DesktopIconMixin, VideoIconMixin):
def create_scaled_image(self, path, wxh): def create_scaled_image(self, path, wxh):
try: try:
pixbuf = GdkPixbuf.Pixbuf.new_from_file(path)#.get_pixbuf() pixbuf = GdkPixbuf.Pixbuf.new_from_file(path)
scaled_pixbuf = pixbuf.scale_simple(wxh[0], wxh[1], 2) # 2 = BILINEAR and is best by default scaled_pixbuf = pixbuf.scale_simple(wxh[0], wxh[1], 2) # 2 = BILINEAR and is best by default
return scaled_pixbuf # Gtk.Image.new_from_pixbuf(scaled_pixbuf) return scaled_pixbuf
except Exception as e: except Exception as e:
print("Image Scaling Issue:") print("Image Scaling Issue:")
print( repr(e) ) print( repr(e) )

View File

@ -80,7 +80,7 @@ class Settings:
fpdf = ('.pdf') fpdf = ('.pdf')
# Dire structure check # Dir structure check
if path.isdir(REMUX_FOLDER) == False: if path.isdir(REMUX_FOLDER) == False:
os.mkdir(REMUX_FOLDER) os.mkdir(REMUX_FOLDER)