Fixed execute persistence post fm closing; cleaned up import scheme
This commit is contained in:
parent
3eebf34106
commit
19c683d9c7
@ -1,12 +1,14 @@
|
||||
# Python imports
|
||||
import builtins
|
||||
|
||||
# Gtk imports
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from signal_classes.DBusControllerMixin import DBusControllerMixin
|
||||
|
||||
|
||||
|
||||
|
||||
class Builtins(DBusControllerMixin):
|
||||
"""Docstring for __builtins__ extender"""
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Python imports
|
||||
import os, inspect, time
|
||||
|
||||
# Gtk imports
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from utils import Settings
|
||||
@ -9,6 +9,8 @@ from signal_classes import Controller
|
||||
from __builtins__ import Builtins
|
||||
|
||||
|
||||
|
||||
|
||||
class Main(Builtins):
|
||||
def __init__(self, args, unknownargs):
|
||||
event_system.create_ipc_server()
|
||||
|
@ -2,15 +2,15 @@
|
||||
|
||||
|
||||
# Python imports
|
||||
import argparse
|
||||
import argparse, faulthandler, traceback
|
||||
from setproctitle import setproctitle
|
||||
|
||||
import tracemalloc
|
||||
tracemalloc.start()
|
||||
|
||||
|
||||
# Gtk imports
|
||||
import gi, faulthandler, traceback
|
||||
# Lib imports
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
|
||||
|
@ -1,6 +1,12 @@
|
||||
|
||||
# Python imports
|
||||
import os, shutil, subprocess, threading
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
|
||||
|
||||
|
||||
|
||||
class FileHandler:
|
||||
def create_file(self, nFile, type):
|
||||
|
@ -1,11 +1,10 @@
|
||||
# Python imports
|
||||
import sys, traceback, threading, subprocess, signal, inspect, os, time
|
||||
|
||||
# Gtk imports
|
||||
# Lib imports
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GLib
|
||||
from gi.repository import Gtk, GLib
|
||||
|
||||
# Application imports
|
||||
from .mixins import *
|
||||
@ -18,6 +17,8 @@ def threaded(fn):
|
||||
return wrapper
|
||||
|
||||
|
||||
|
||||
|
||||
class Controller(WidgetFileActionMixin, PaneMixin, WindowMixin, ShowHideMixin, \
|
||||
KeyboardSignalsMixin, Controller_Data):
|
||||
def __init__(self, args, unknownargs, _settings):
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Python imports
|
||||
|
||||
# Gtk imports
|
||||
# Lib imports
|
||||
from gi.repository import GLib
|
||||
|
||||
# Application imports
|
||||
|
@ -2,7 +2,7 @@
|
||||
import threading, socket, time
|
||||
from multiprocessing.connection import Listener, Client
|
||||
|
||||
# Gtk imports
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
|
||||
@ -13,6 +13,8 @@ def threaded(fn):
|
||||
return wrapper
|
||||
|
||||
|
||||
|
||||
|
||||
class DBusControllerMixin:
|
||||
|
||||
@threaded
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Python imports
|
||||
|
||||
# Gtk imports
|
||||
# Lib imports
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
gi.require_version('Gdk', '3.0')
|
||||
@ -9,6 +9,8 @@ from gi.repository import Gtk, Gdk
|
||||
# Application imports
|
||||
|
||||
|
||||
|
||||
|
||||
class KeyboardSignalsMixin:
|
||||
def global_key_press_controller(self, eve, user_data):
|
||||
keyname = Gdk.keyval_name(user_data.keyval).lower()
|
||||
|
@ -1,7 +1,13 @@
|
||||
# Python imports
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
|
||||
|
||||
|
||||
# # TODO: Should rewrite to try and support more windows more naturally
|
||||
|
||||
# TODO: Should rewrite to try and support more windows more naturally
|
||||
class PaneMixin:
|
||||
"""docstring for PaneMixin"""
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
from . import WidgetMixin
|
||||
|
||||
|
||||
|
||||
|
||||
class TabMixin(WidgetMixin):
|
||||
"""docstring for TabMixin"""
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Python imports
|
||||
import threading, os
|
||||
import os
|
||||
|
||||
# Lib imports
|
||||
import gi
|
||||
@ -10,11 +10,6 @@ from gi.repository import Gtk, GObject, Gio
|
||||
|
||||
|
||||
|
||||
def threaded(fn):
|
||||
def wrapper(*args, **kwargs):
|
||||
threading.Thread(target=fn, args=args, kwargs=kwargs).start()
|
||||
return wrapper
|
||||
|
||||
|
||||
class WidgetFileActionMixin:
|
||||
def set_file_watcher(self, view):
|
||||
@ -68,18 +63,12 @@ class WidgetFileActionMixin:
|
||||
for file in uris:
|
||||
view.open_file_locally(file)
|
||||
|
||||
@threaded
|
||||
def open_with_files(self, appchooser_widget):
|
||||
wid, tid, view, iconview, store = self.get_current_state()
|
||||
app_info = appchooser_widget.get_app_info()
|
||||
uris = self.format_to_uris(store, wid, tid, self.selected_files, True)
|
||||
files = []
|
||||
uris = self.format_to_uris(store, wid, tid, self.selected_files)
|
||||
|
||||
for uri in uris:
|
||||
gio_file = Gio.File.new_for_path(uri)
|
||||
files.append(gio_file)
|
||||
|
||||
app_info.launch(files, None)
|
||||
app_info.launch_uris_async(uris)
|
||||
|
||||
def execute_files(self, in_terminal=False):
|
||||
wid, tid, view, iconview, store = self.get_current_state()
|
||||
@ -88,7 +77,7 @@ class WidgetFileActionMixin:
|
||||
command = None
|
||||
|
||||
for path in paths:
|
||||
command = f"sh -c '{path}'" if not in_terminal else f"{view.terminal_app} -e '{path}'"
|
||||
command = f"exec '{path}'" if not in_terminal else f"{view.terminal_app} -e '{path}'"
|
||||
view.execute(command, start_dir=view.get_current_directory(), use_os_system=False)
|
||||
|
||||
def archive_files(self, archiver_dialogue):
|
||||
|
@ -6,11 +6,7 @@ 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
|
||||
from gi.repository import Gio
|
||||
from gi.repository import GdkPixbuf
|
||||
from gi.repository import Gtk, Gdk, GLib, Gio, GdkPixbuf
|
||||
|
||||
# Application imports
|
||||
|
||||
@ -22,6 +18,7 @@ def threaded(fn):
|
||||
|
||||
|
||||
|
||||
|
||||
class WidgetMixin:
|
||||
|
||||
def load_store(self, view, store, save_state=False):
|
||||
|
@ -3,13 +3,14 @@ import copy
|
||||
from os.path import isdir, isfile
|
||||
|
||||
|
||||
# Gtk imports
|
||||
# Lib imports
|
||||
import gi
|
||||
gi.require_version('Gdk', '3.0')
|
||||
from gi.repository import Gdk
|
||||
|
||||
# Application imports
|
||||
from . import TabMixin
|
||||
from . import WidgetMixin
|
||||
from . import TabMixin, WidgetMixin
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user