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