pins: fixup #1242
This commit is contained in:
@@ -100,6 +100,10 @@ def get_software_version():
|
|||||||
return "?"
|
return "?"
|
||||||
|
|
||||||
|
|
||||||
|
def parse_bool(value):
|
||||||
|
return value.lower() == "true"
|
||||||
|
|
||||||
|
|
||||||
def patch_threading_excepthook():
|
def patch_threading_excepthook():
|
||||||
"""Installs our exception handler into the threading modules Thread object
|
"""Installs our exception handler into the threading modules Thread object
|
||||||
Inspired by https://bugs.python.org/issue1230540
|
Inspired by https://bugs.python.org/issue1230540
|
||||||
|
@@ -4,6 +4,7 @@ import gi
|
|||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
from gi.repository import Gtk, GLib, Pango
|
from gi.repository import Gtk, GLib, Pango
|
||||||
from ks_includes.screen_panel import ScreenPanel
|
from ks_includes.screen_panel import ScreenPanel
|
||||||
|
from ks_includes.functions import parse_bool
|
||||||
|
|
||||||
|
|
||||||
class Panel(ScreenPanel):
|
class Panel(ScreenPanel):
|
||||||
@@ -40,7 +41,7 @@ class Panel(ScreenPanel):
|
|||||||
|
|
||||||
self.devices[pin] = {}
|
self.devices[pin] = {}
|
||||||
section = self._printer.get_config_section(pin)
|
section = self._printer.get_config_section(pin)
|
||||||
if section.get('pwm') or section.get('hardware_pwm'):
|
if parse_bool(section.get('pwm', 'false')) or parse_bool(section.get('hardware_pwm', 'false')):
|
||||||
scale = Gtk.Scale.new_with_range(Gtk.Orientation.HORIZONTAL, min=0, max=100, step=1)
|
scale = Gtk.Scale.new_with_range(Gtk.Orientation.HORIZONTAL, min=0, max=100, step=1)
|
||||||
scale.set_value(self.check_pin_value(pin))
|
scale.set_value(self.check_pin_value(pin))
|
||||||
scale.set_digits(0)
|
scale.set_digits(0)
|
||||||
|
Reference in New Issue
Block a user