Made imports pythonic
This commit is contained in:
parent
1e7ad1ea34
commit
9db3dea48a
|
@ -1,4 +1,5 @@
|
||||||
import builtins, threading
|
import builtins
|
||||||
|
import threading
|
||||||
|
|
||||||
# Python imports
|
# Python imports
|
||||||
import builtins
|
import builtins
|
||||||
|
|
|
@ -82,6 +82,6 @@ class Controller(DummyMixin, ControllerData):
|
||||||
|
|
||||||
def set_clipboard_data(self, data: type) -> None:
|
def set_clipboard_data(self, data: type) -> None:
|
||||||
proc = subprocess.Popen(['xclip','-selection','clipboard'], stdin=subprocess.PIPE)
|
proc = subprocess.Popen(['xclip','-selection','clipboard'], stdin=subprocess.PIPE)
|
||||||
proc.stdin.write(data)
|
proc.stdin.write(data.encode("utf-8"))
|
||||||
proc.stdin.close()
|
proc.stdin.close()
|
||||||
retcode = proc.wait()
|
retcode = proc.wait()
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
# Python imports
|
||||||
|
|
||||||
|
# Lib imports
|
||||||
|
|
||||||
|
# Application imports
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DummyMixin:
|
class DummyMixin:
|
||||||
""" DummyMixin is an example of how mixins are used and structured in a project. """
|
""" DummyMixin is an example of how mixins are used and structured in a project. """
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# Python imports
|
# Python imports
|
||||||
import os, json
|
import os
|
||||||
|
import json
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
|
||||||
# Lib imports
|
# Lib imports
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# Python imports
|
# Python imports
|
||||||
import os, time
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
# Lib imports
|
# Lib imports
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
# Python imports
|
# Python imports
|
||||||
import os, sys, importlib, traceback
|
import os
|
||||||
from os.path import join, isdir
|
import sys
|
||||||
|
import portlib
|
||||||
|
import traceback
|
||||||
|
from os.path import join
|
||||||
|
from os.path import isdir
|
||||||
|
|
||||||
# Lib imports
|
# Lib imports
|
||||||
import gi
|
import gi
|
||||||
gi.require_version('Gtk', '3.0')
|
gi.require_version('Gtk', '3.0')
|
||||||
from gi.repository import Gtk, Gio
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import Gio
|
||||||
|
|
||||||
# Application imports
|
# Application imports
|
||||||
from .manifest import Plugin, ManifestProcessor
|
from .manifest import Plugin, ManifestProcessor
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
# Python imports
|
# Python imports
|
||||||
import os, threading, time
|
import os
|
||||||
from multiprocessing.connection import Listener, Client
|
import threading
|
||||||
|
import ime
|
||||||
|
from multiprocessing.connection import Client
|
||||||
|
from multiprocessing.connection import Listener
|
||||||
|
|
||||||
# Lib imports
|
# Lib imports
|
||||||
|
|
||||||
|
@ -55,11 +58,11 @@ class IPCServer:
|
||||||
while True:
|
while True:
|
||||||
conn = listener.accept()
|
conn = listener.accept()
|
||||||
start_time = time.perf_counter()
|
start_time = time.perf_counter()
|
||||||
self.handle_ipc_message(conn, start_time)
|
self._handle_ipc_message(conn, start_time)
|
||||||
|
|
||||||
listener.close()
|
listener.close()
|
||||||
|
|
||||||
def handle_ipc_message(self, conn, start_time) -> None:
|
def _handle_ipc_message(self, conn, start_time) -> None:
|
||||||
while True:
|
while True:
|
||||||
msg = conn.recv()
|
msg = conn.recv()
|
||||||
if settings.is_debug():
|
if settings.is_debug():
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# Python imports
|
# Python imports
|
||||||
import os, logging
|
import os
|
||||||
|
import logging
|
||||||
|
|
||||||
# Application imports
|
# Application imports
|
||||||
|
|
||||||
|
|
|
@ -114,16 +114,16 @@ class Settings:
|
||||||
self._builder.connect_signals(handlers)
|
self._builder.connect_signals(handlers)
|
||||||
|
|
||||||
|
|
||||||
def get_builder(self) -> any: return self._builder
|
|
||||||
def set_builder(self, builder) -> any: self._builder = builder
|
def set_builder(self, builder) -> any: self._builder = builder
|
||||||
|
def get_builder(self) -> any: return self._builder
|
||||||
def get_glade_file(self) -> str: return self._GLADE_FILE
|
def get_glade_file(self) -> str: return self._GLADE_FILE
|
||||||
|
|
||||||
def get_logger(self) -> Logger: return self._logger
|
def get_logger(self) -> Logger: return self._logger
|
||||||
def get_plugins_path(self) -> str: return self._PLUGINS_PATH
|
def get_plugins_path(self) -> str: return self._PLUGINS_PATH
|
||||||
def get_icon_theme(self) -> str: return self._ICON_THEME
|
def get_icon_theme(self) -> str: return self._ICON_THEME
|
||||||
def get_css_file(self) -> str: return self._CSS_FILE
|
def get_css_file(self) -> str: return self._CSS_FILE
|
||||||
def get_window_icon(self) -> str: return self._WINDOW_ICON
|
def get_window_icon(self) -> str: return self._WINDOW_ICON
|
||||||
def get_home_path(self) -> str: return self._USER_HOME
|
def get_home_path(self) -> str: return self._USER_HOME
|
||||||
|
|
||||||
# Filter returns
|
# Filter returns
|
||||||
def get_office_filter(self) -> tuple: return self._office_filter
|
def get_office_filter(self) -> tuple: return self._office_filter
|
||||||
|
@ -139,7 +139,7 @@ class Settings:
|
||||||
|
|
||||||
def is_trace_debug(self) -> str: return self._trace_debug
|
def is_trace_debug(self) -> str: return self._trace_debug
|
||||||
def is_debug(self) -> str: return self._debug
|
def is_debug(self) -> str: return self._debug
|
||||||
def is_dirty_start(self) -> bool: return self._dirty_start
|
def is_dirty_start(self) -> bool: return self._dirty_start
|
||||||
def clear_pid(self): self._clean_pid()
|
def clear_pid(self): self._clean_pid()
|
||||||
|
|
||||||
def set_trace_debug(self, trace_debug):
|
def set_trace_debug(self, trace_debug):
|
||||||
|
|
Loading…
Reference in New Issue