Skip to content

Commit

Permalink
Linting in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rn3j committed Jan 18, 2025
1 parent 91efb7a commit 7ef9cfa
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions scc/gui/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Allows to edit button or trigger action.
"""
import os, logging

from scc.tools import _

from gi.repository import Gtk, Gdk, GLib
Expand All @@ -13,7 +15,6 @@
from scc.gui.gdk_to_key import keyevent_to_key
from scc.gui.area_to_action import AREA_TO_ACTION

import os, logging
log = logging.getLogger("Editor")


Expand All @@ -37,7 +38,8 @@ def set_cb(self, cb, key, keyindex=0) -> bool:


class Editor(ComboSetter):
""" Common stuff for all editor windows """
"""Common stuff for all editor windows"""

ERROR_CSS = " #error {background-color:green; color:red;} "
_error_css_provider = None

Expand All @@ -46,7 +48,7 @@ def __init__(self):


def on_window_key_press_event(self, trash, event):
""" Checks if pressed key was escape and if yes, closes window """
"""Checks if pressed key was escape and if yes, closes window"""
if event.keyval == Gdk.KEY_Escape:
self.close()

Expand All @@ -70,10 +72,7 @@ def install_error_css():


def hide_dont_destroy(self, w, *a):
"""
When used as handler for 'delete-event' signal, prevents window from
being destroyed after closing.
"""
"""When used as handler for 'delete-event' signal, prevents window from being destroyed after closing."""
w.hide()
return True

Expand All @@ -88,9 +87,7 @@ def close(self, *a):


def get_transient_for(self):
"""
Returns parent window for this editor. Usually main application window
"""
"""Return parent window for this editor. Usually main application window"""
return self._transient_for


Expand All @@ -103,8 +100,7 @@ def show(self, transient_for):


def add_widget(self, label, widget):
"""
Adds new widget into row before Action Name.
"""Add new widget into row before Action Name.
Widget is automatically passed to Macro Editor or Modeshift Editor
if either one is opened from editor window.
Expand All @@ -124,8 +120,8 @@ def add_widget(self, label, widget):


def remove_added_widget(self):
"""
Removes added widget, if any.
"""Remove added widget, if any.
Should be called from on_destory handlers.
"""
vbAddedWidget = self.builder.get_object("vbAddedWidget")
Expand All @@ -135,7 +131,7 @@ def remove_added_widget(self):


def send_added_widget(self, target):
""" Transfers added widget to new editor window """
"""Transfer added widget to new editor window"""
if self.added_widget:
vbAddedWidget = self.builder.get_object("vbAddedWidget")
lblAddedWidget = self.builder.get_object("lblAddedWidget")
Expand Down

0 comments on commit 7ef9cfa

Please sign in to comment.