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