Skip to content

Commit

Permalink
PEP8 double aggressive E301 ~ E306
Browse files Browse the repository at this point in the history
  • Loading branch information
persianpros committed Apr 10, 2021
1 parent a647a84 commit 3349a10
Show file tree
Hide file tree
Showing 312 changed files with 1,414 additions and 24 deletions.
3 changes: 3 additions & 0 deletions lib/actions/parseactions.py
Expand Up @@ -3,6 +3,7 @@
import tokenize
import sys


def filter(g):
while 1:
t = g.next()
Expand All @@ -19,6 +20,7 @@ def filter(g):
# print t
yield t[1]


def do_file(f, mode):
tokens = filter(tokenize.generate_tokens(open(f, 'r').readline))

Expand Down Expand Up @@ -101,6 +103,7 @@ def do_file(f, mode):

counter += 1


mode = sys.argv[1]

if mode == "parse":
Expand Down
2 changes: 2 additions & 0 deletions lib/python/Components/AVSwitch.py
Expand Up @@ -3,6 +3,7 @@
from SystemInfo import SystemInfo
import os


class AVSwitch:
def setInput(self, input):
INPUT = {"ENCODER": 0, "SCART": 1, "AUX": 2}
Expand Down Expand Up @@ -63,6 +64,7 @@ def setAspectWSS(self, aspect=None):
value = 1 # auto
eAVSwitch.getInstance().setWSS(value)


def InitAVSwitch():
config.av = ConfigSubsection()
config.av.yuvenabled = ConfigBoolean(default=True)
Expand Down
18 changes: 18 additions & 0 deletions lib/python/Components/About.py
Expand Up @@ -5,9 +5,11 @@
import re
from Tools.HardwareInfo import HardwareInfo


def getVersionString():
return getImageVersionString()


def getImageVersionString():
try:
if os.path.isfile('/var/lib/opkg/status'):
Expand All @@ -20,9 +22,12 @@ def getImageVersionString():
return _("unavailable")

# WW -placeholder for BC purposes, commented out for the moment in the Screen


def getFlashDateString():
return _("unknown")


def getBuildDateString():
try:
if os.path.isfile('/etc/version'):
Expand All @@ -32,6 +37,7 @@ def getBuildDateString():
pass
return _("unknown")


def getUpdateDateString():
try:
from glob import glob
Expand All @@ -42,13 +48,15 @@ def getUpdateDateString():
pass
return _("unknown")


def getEnigmaVersionString():
import enigma
enigma_version = enigma.getEnigmaVersionString()
if '-(no branch)' in enigma_version:
enigma_version = enigma_version[:-12]
return enigma_version


def getGStreamerVersionString():
try:
from glob import glob
Expand All @@ -57,6 +65,7 @@ def getGStreamerVersionString():
except:
return _("Not Installed")


def getffmpegVersionString():
try:
from glob import glob
Expand All @@ -65,22 +74,26 @@ def getffmpegVersionString():
except:
return _("Not Installed")


def getKernelVersionString():
try:
return open("/proc/version", "r").read().split(' ', 4)[2].split('-', 2)[0]
except:
return _("unknown")


def getHardwareTypeString():
return HardwareInfo().get_device_string()


def getImageTypeString():
try:
image_type = open("/etc/issue").readlines()[-2].strip()[:-6]
return image_type.capitalize()
except:
return _("undefined")


def getCPUInfoString():
try:
cpu_count = 0
Expand Down Expand Up @@ -131,6 +144,7 @@ def getCPUInfoString():
except:
return _("undefined")


def getDriverInstalledDate():
try:
from glob import glob
Expand All @@ -147,6 +161,7 @@ def getDriverInstalledDate():
except:
return _("unknown")


def getPythonVersionString():
try:
import commands
Expand All @@ -155,6 +170,7 @@ def getPythonVersionString():
except:
return _("unknown")


def GetIPsFromNetworkInterfaces():
import socket
import fcntl
Expand Down Expand Up @@ -188,6 +204,7 @@ def GetIPsFromNetworkInterfaces():
ifaces.append((iface_name, iface_addr))
return ifaces


def getBoxUptime():
try:
time = ''
Expand All @@ -206,5 +223,6 @@ def getBoxUptime():
except:
return '-'


# For modules that do "from About import about"
about = sys.modules[__name__]
2 changes: 2 additions & 0 deletions lib/python/Components/BlinkingPixmap.py
@@ -1,10 +1,12 @@
from Pixmap import PixmapConditional
from ConditionalWidget import BlinkingWidgetConditional, BlinkingWidget


class BlinkingPixmap(BlinkingWidget):
def __init__(self):
Widget.__init__(self)


class BlinkingPixmapConditional(BlinkingWidgetConditional, PixmapConditional):
def __init__(self):
BlinkingWidgetConditional.__init__(self)
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Button.py
Expand Up @@ -3,6 +3,7 @@

from enigma import eButton


class Button(VariableText, GUIComponent):
def __init__(self, text="", onClick=[]):
GUIComponent.__init__(self)
Expand Down
2 changes: 2 additions & 0 deletions lib/python/Components/ChoiceList.py
Expand Up @@ -4,6 +4,7 @@
from Tools.LoadPixmap import LoadPixmap
import skin


def ChoiceEntryComponent(key=None, text=["--"]):
res = [text]
if text[0] == "--":
Expand Down Expand Up @@ -33,6 +34,7 @@ def ChoiceEntryComponent(key=None, text=["--"]):
res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, text[0]))
return res


class ChoiceList(MenuList):
def __init__(self, list, selection=0, enableWrapAround=False):
MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Clock.py
Expand Up @@ -6,6 +6,7 @@
import time
# now some "real" components:


class Clock(VariableText, GUIComponent):
def __init__(self):
VariableText.__init__(self)
Expand Down
3 changes: 3 additions & 0 deletions lib/python/Components/ConditionalWidget.py
@@ -1,6 +1,7 @@
from GUIComponent import GUIComponent
from enigma import eTimer


class ConditionalWidget(GUIComponent):
def __init__(self, withTimer=True):
GUIComponent.__init__(self)
Expand Down Expand Up @@ -32,6 +33,7 @@ def update(self):
self.conditionalFunction = None
self.activateCondition(False)


class BlinkingWidget(GUIComponent):
def __init__(self):
GUIComponent.__init__(self)
Expand All @@ -57,6 +59,7 @@ def stopBlinking(self):
self.hide()
self.timer.stop()


class BlinkingWidgetConditional(BlinkingWidget, ConditionalWidget):
def __init__(self):
BlinkingWidget.__init__(self)
Expand Down
2 changes: 2 additions & 0 deletions lib/python/Components/ConfigList.py
Expand Up @@ -6,6 +6,7 @@
from Screens.ChoiceBox import ChoiceBox
import skin


class ConfigList(GUIComponent, object):
def __init__(self, list, session=None):
GUIComponent.__init__(self)
Expand Down Expand Up @@ -130,6 +131,7 @@ def selectionEnabled(self, enabled):
if self.instance is not None:
self.instance.setSelectionEnable(enabled)


class ConfigListScreen:
def __init__(self, list, session=None, on_change=None):
self["config_actions"] = NumberActionMap(["SetupActions", "InputAsciiActions", "KeyboardInputActions"], {
Expand Down
4 changes: 4 additions & 0 deletions lib/python/Components/Console.py
Expand Up @@ -2,6 +2,7 @@
import ctypes
import os


class ConsoleItem:
def __init__(self, containers, cmd, callback, extra_args):
self.extra_args = extra_args
Expand Down Expand Up @@ -30,8 +31,10 @@ def __init__(self, containers, cmd, callback, extra_args):
os.waitpid(self.container.getPID(), 0)
except:
pass

def dataAvailCB(self, data):
self.appResults.append(data)

def finishedCB(self, retval):
print "[Console] finished:", self.name
del self.containers[self.name]
Expand All @@ -43,6 +46,7 @@ def finishedCB(self, retval):
data = ''.join(self.appResults)
callback(data, retval, self.extra_args)


class Console(object):
def __init__(self):
# Still called appContainers because Network.py accesses it to
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/Converter/AnalogClock.py
Expand Up @@ -2,6 +2,7 @@
from Components.Element import cached
from time import localtime, strftime


class AnalogClock(Converter, object):

def __init__(self, type):
Expand Down Expand Up @@ -30,5 +31,4 @@ def getValue(self):
elif self.type == 3:
return int(((t.tm_hour * 100) / 12) + (t.tm_min / 8))


value = property(getValue)
1 change: 1 addition & 0 deletions lib/python/Components/Converter/ClientsStreaming.py
Expand Up @@ -6,6 +6,7 @@
from ServiceReference import ServiceReference
import socket


class ClientsStreaming(Converter, Poll, object):
UNKNOWN = -1
REF = 0
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Converter/ClockToText.py
Expand Up @@ -2,6 +2,7 @@
from time import localtime, strftime
from Components.Element import cached


class ClockToText(Converter, object):
DEFAULT = 0
WITH_SECONDS = 1
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Converter/Combine.py
@@ -1,6 +1,7 @@
from Converter import Converter
from Components.Element import cached


class Combine(Converter, object):
SINGLE_SOURCE = False

Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Converter/ConditionalShowHide.py
@@ -1,6 +1,7 @@
from enigma import eTimer
from Converter import Converter


class ConditionalShowHide(Converter, object):
def __init__(self, argstr):
Converter.__init__(self, argstr)
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Converter/ConfigEntryTest.py
Expand Up @@ -3,6 +3,7 @@

from Components.config import configfile


class ConfigEntryTest(Converter, object):
def __init__(self, argstr):
Converter.__init__(self, argstr)
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Converter/Converter.py
@@ -1,5 +1,6 @@
from Components.Element import Element


class Converter(Element):
def __init__(self, arguments):
Element.__init__(self)
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Converter/EventName.py
Expand Up @@ -2,6 +2,7 @@
from Components.Element import cached
from Components.Converter.genre import getGenreStringSub


class EventName(Converter, object):
NAME = 0
SHORT_DESCRIPTION = 1
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Converter/EventTime.py
Expand Up @@ -3,6 +3,7 @@
from time import time
from Components.Element import cached, ElementError


class EventTime(Poll, Converter, object):
STARTTIME = 0
ENDTIME = 1
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Converter/FrontendInfo.py
Expand Up @@ -5,6 +5,7 @@
from skin import parameters
from Tools.Hex2strColor import Hex2strColor


class FrontendInfo(Converter):
BER = 0
SNR = 1
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Converter/MenuEntryCompare.py
@@ -1,6 +1,7 @@
from Components.Converter.Converter import Converter
from Components.Element import cached


class MenuEntryCompare(Converter, object):
def __init__(self, type):
Converter.__init__(self, type)
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Converter/MovieInfo.py
Expand Up @@ -3,6 +3,7 @@
from enigma import iServiceInformation, eServiceReference
from ServiceReference import ServiceReference


class MovieInfo(Converter):
MOVIE_SHORT_DESCRIPTION = 0 # meta description when available.. when not .eit short description
MOVIE_META_DESCRIPTION = 1 # just meta description when available
Expand Down
2 changes: 2 additions & 0 deletions lib/python/Components/Converter/PliExtraInfo.py
Expand Up @@ -57,11 +57,13 @@
21: "SPARK",
}


def addspace(text):
if text:
text += " "
return text


class PliExtraInfo(Poll, Converter):
def __init__(self, type):
Converter.__init__(self, type)
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Converter/Poll.py
@@ -1,5 +1,6 @@
from enigma import eTimer


class Poll(object):
def __init__(self):
self.__poll_timer = eTimer()
Expand Down

0 comments on commit 3349a10

Please sign in to comment.