Skip to content

Commit

Permalink
Reduce block JobTask
Browse files Browse the repository at this point in the history
*It has been necessary to reduce this block to avoid this:

        Traceback (most recent call last):
          File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner

          File "/usr/lib/python2.7/threading.py", line 754, in run

          File "/usr/lib/python2.7/site-packages/twisted/_threads/_threadworker.py", line 46, in work

          File "/usr/lib/python2.7/site-packages/twisted/_threads/_team.py", line 190, in doWork

        --- <exception caught here> ---
          File "/usr/lib/python2.7/site-packages/twisted/python/threadpool.py", line 250, in inContext

          File "/usr/lib/python2.7/site-packages/twisted/python/threadpool.py", line 266, in <lambda>

          File "/usr/lib/python2.7/site-packages/twisted/python/context.py", line 122, in callWithContext

          File "/usr/lib/python2.7/site-packages/twisted/python/context.py", line 85, in callWithContext

          File "/usr/lib/enigma2/python/Components/Lcd.py", line 64, in JobTask
            busses = usb.busses()
          File "/usr/lib/python2.7/site-packages/usb/legacy.py", line 340, in busses
            _interop._sorted(core.find(find_all=True), key=lambda d: d.bus),
          File "/usr/lib/python2.7/site-packages/usb/core.py", line 1199, in find
            raise ValueError('No backend available')
  • Loading branch information
norhap committed Nov 6, 2019
1 parent a4bf894 commit bb1de30
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions lib/python/Components/Lcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@ def iconcheck(self):
pass
self.timer.startLongTimer(30)

def JobTask(self):
LinkState = 0
if fileExists('/sys/class/net/wlan0/operstate'):
def JobTask(self):
LinkState = 0
if fileExists('/sys/class/net/wlan0/operstate'):
LinkState = open('/sys/class/net/wlan0/operstate').read()
if LinkState != 'down':
LinkState = open('/sys/class/net/wlan0/operstate').read()
if LinkState != 'down':
LinkState = open('/sys/class/net/wlan0/operstate').read()
elif fileExists('/sys/class/net/eth0/operstate'):
LinkState = open('/sys/class/net/eth0/operstate').read()
if LinkState != 'down':
LinkState = open('/sys/class/net/eth0/carrier').read()
LinkState = LinkState[:1]
if fileExists("/proc/stb/lcd/symbol_network") and config.lcd.mode.value == '1':
open("/proc/stb/lcd/symbol_network", "w").write(str(LinkState))
elif fileExists("/proc/stb/lcd/symbol_network") and config.lcd.mode.value == '0':
open("/proc/stb/lcd/symbol_network", "w").write("0")

USBState = 0
busses = usb.busses()
for bus in busses:
devices = bus.devices
for dev in devices:
if dev.deviceClass != 9 and dev.deviceClass != 2 and dev.idVendor != 3034 and dev.idVendor > 0:
USBState = 1
if fileExists("/proc/stb/lcd/symbol_usb"):
open("/proc/stb/lcd/symbol_usb", "w").write(str(USBState))

self.timer.startLongTimer(30)
elif fileExists('/sys/class/net/eth0/operstate'):
LinkState = open('/sys/class/net/eth0/operstate').read()
if LinkState != 'down':
LinkState = open('/sys/class/net/eth0/carrier').read()
LinkState = LinkState[:1]
if fileExists("/proc/stb/lcd/symbol_network") and config.lcd.mode.value == '1':
open("/proc/stb/lcd/symbol_network", "w").write(str(LinkState))
elif fileExists("/proc/stb/lcd/symbol_network") and config.lcd.mode.value == '0':
open("/proc/stb/lcd/symbol_network", "w").write("0")

USBState = 0
busses = usb.busses()
for bus in busses:
devices = bus.devices
for dev in devices:
if dev.deviceClass != 9 and dev.deviceClass != 2 and dev.idVendor != 3034 and dev.idVendor > 0:
USBState = 1
if fileExists("/proc/stb/lcd/symbol_usb"):
open("/proc/stb/lcd/symbol_usb", "w").write(str(USBState))

self.timer.startLongTimer(30)

class LCD:
def __init__(self):
Expand Down Expand Up @@ -169,7 +169,7 @@ def setInverted(self, value):

def setFlipped(self, value):
eDBoxLCD.getInstance().setFlipped(value)

def setScreenShot(self, value):
eDBoxLCD.getInstance().setDump(value)

Expand Down

0 comments on commit bb1de30

Please sign in to comment.