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,8 +114,8 @@ 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
|
||||
|
|
Loading…
Reference in New Issue