Skip to content

Commit

Permalink
Don't mix tab and space indentation
Browse files Browse the repository at this point in the history
Replace space with tab indentation
  • Loading branch information
betacentauri committed Mar 2, 2019
1 parent ecee7c6 commit 3856ef5
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 85 deletions.
4 changes: 2 additions & 2 deletions keymapparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def parseTrans(filename, actionmap, device, keys):
get_attr = x.attrib.get
toggle_key = get_attr("from")
toggle_key = getKeyId(toggle_key)
actionmap.bindToggle(filename, device, toggle_key)
actionmap.bindToggle(filename, device, toggle_key)

for x in keys.findall("key"):
get_attr = x.attrib.get
Expand All @@ -71,7 +71,7 @@ def parseTrans(filename, actionmap, device, keys):
keyin = getKeyId(keyin)
keyout = getKeyId(keyout)
toggle = int(toggle)
actionmap.bindTranslation(filename, device, keyin, keyout, toggle)
actionmap.bindTranslation(filename, device, keyin, keyout, toggle)


def readKeymap(filename):
Expand Down
10 changes: 5 additions & 5 deletions lib/python/Components/Converter/Streaming2.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ def getText(self):
else:
return _("=NO STREAM\n")

retval = "+%d:%s" % (s["demux"], ','.join(["%x:%s" % (x[0], x[1]) for x in s["pids"]]))
retval = "+%d:%s" % (s["demux"], ','.join(["%x:%s" % (x[0], x[1]) for x in s["pids"]]))

if "default_audio_pid" in s and s["default_audio_pid"] >= 0:
retval += ",%x:%s" % (s["default_audio_pid"], "default_audio_pid")
if "default_audio_pid" in s and s["default_audio_pid"] >= 0:
retval += ",%x:%s" % (s["default_audio_pid"], "default_audio_pid")

retval += "\n"
retval += "\n"

return(retval);
return(retval);

text = property(getText)
2 changes: 1 addition & 1 deletion lib/python/Components/MediaPlayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def PlaylistEntryComponent(self, serviceref, state):
x, y, w, h = skin.parameters.get("PlayListIcon",(5, 3, 16, 16))
res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, x, y, w, h, png))
except:
pass
pass
return res

def clear(self):
Expand Down
14 changes: 7 additions & 7 deletions lib/python/Components/MovieList.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,28 +463,28 @@ def buildMovieListEntry(self, serviceref, info, begin, data):
res.append(MultiContentEntryText(pos=(0, ih1), size=(width-r, ih2-ih1), font=1, flags=RT_HALIGN_LEFT, text=data.description))
res.append(MultiContentEntryText(pos=(0, ih2), size=(sc-r, ih-ih2), font=1, flags=RT_HALIGN_LEFT, text=begin_string))
if len:
res.append(MultiContentEntryText(pos=(width-sc-r, ih2), size=(sc, ih-ih2), font=1, flags=RT_HALIGN_RIGHT, text=len))
res.append(MultiContentEntryText(pos=(width-sc-r, ih2), size=(sc, ih-ih2), font=1, flags=RT_HALIGN_RIGHT, text=len))
elif self.list_type == MovieList.LISTTYPE_COMPACT_DESCRIPTION:
ih1 = ((ih * 8) + 14) / 15 # 37 -> 20, round up
if len:
lenSize = 58 * ih / 37
lenSize = 58 * ih / 37
else:
lenSize = 0
lenSize = 0
fc, sc, tc = self.columnsCompactDescription[0], self.columnsCompactDescription[1], self.columnsCompactDescription[2]
res.append(MultiContentEntryText(pos=(iconSize+space, 0), size=(width-sc-r, ih1), font = 0, flags = RT_HALIGN_LEFT, text = data.txt))
res.append(MultiContentEntryText(pos=(0, ih1), size=(width-tc-lenSize-r, ih-ih1), font=1, flags=RT_HALIGN_LEFT, text=data.description))
res.append(MultiContentEntryText(pos=(width-fc-r, 6), size=(fc, ih1), font=1, flags=RT_HALIGN_RIGHT, text=begin_string))
if data.serviceName:
res.append(MultiContentEntryText(pos=(width-tc-lenSize-r, ih1), size=(tc, ih-ih1), font = 1, flags = RT_HALIGN_RIGHT, text = data.serviceName))
if lenSize:
res.append(MultiContentEntryText(pos=(width-lenSize-r, ih1), size=(lenSize, ih-ih1), font=1, flags=RT_HALIGN_RIGHT, text=len))
res.append(MultiContentEntryText(pos=(width-lenSize-r, ih1), size=(lenSize, ih-ih1), font=1, flags=RT_HALIGN_RIGHT, text=len))
elif self.list_type == MovieList.LISTTYPE_COMPACT:
col = self.compactColumn
ih1 = ((ih * 8) + 14) / 15 # 37 -> 20, round up
if len:
lenSize = 2 * ih
lenSize = 2 * ih
else:
lenSize = 0
lenSize = 0
res.append(MultiContentEntryText(pos=(iconSize+space, 0), size=(width-lenSize-iconSize-space-r, ih1), font = 0, flags = RT_HALIGN_LEFT, text = data.txt))
if self.tags:
res.append(MultiContentEntryText(pos=(width-col-r, ih1), size=(col, ih-ih1), font = 1, flags = RT_HALIGN_RIGHT, text = info.getInfoString(serviceref, iServiceInformation.sTags)))
Expand All @@ -495,7 +495,7 @@ def buildMovieListEntry(self, serviceref, info, begin, data):
res.append(MultiContentEntryText(pos=(width-col-r, ih1), size=(col, ih-ih1), font = 1, flags = RT_HALIGN_RIGHT, text = data.serviceName))
res.append(MultiContentEntryText(pos=(0, ih1), size=(col, ih-ih1), font=1, flags=RT_HALIGN_LEFT, text=begin_string))
if lenSize:
res.append(MultiContentEntryText(pos=(width-lenSize-r, 0), size=(lenSize, ih1), font=0, flags=RT_HALIGN_RIGHT, text=len))
res.append(MultiContentEntryText(pos=(width-lenSize-r, 0), size=(lenSize, ih1), font=0, flags=RT_HALIGN_RIGHT, text=len))
else:
if (self.descr_state == MovieList.SHOW_DESCRIPTION) or not len:
dateSize = ih * 145 / 25 # 25 -> 145
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/PluginComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def readPluginList(self, directory):
try:
os.rmdir(path)
except:
pass
pass
continue

# allow single entry not to be a list
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Components/RcModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from Tools.Directories import SCOPE_SKIN, resolveFilename

class RcModel:
RcModels = {}
RcModels = {}

def __init__(self):
self.model = HardwareInfo().get_device_model()
Expand Down
48 changes: 24 additions & 24 deletions lib/python/Plugins/Extensions/DVDBurn/DVDProject.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ def loadProject(self, filename):
file.close()
projectfiledom = xml.dom.minidom.parseString(data)
for node in projectfiledom.childNodes[0].childNodes:
print "node:", node
if node.nodeType == xml.dom.minidom.Element.nodeType:
if node.tagName == 'settings':
self.xmlAttributesToConfig(node, self.settings)
elif node.tagName == 'titles':
self.xmlGetTitleNodeRecursive(node)
print "node:", node
if node.nodeType == xml.dom.minidom.Element.nodeType:
if node.tagName == 'settings':
self.xmlAttributesToConfig(node, self.settings)
elif node.tagName == 'titles':
self.xmlGetTitleNodeRecursive(node)

for key in self.filekeys:
val = self.settings.dict()[key].getValue()
Expand All @@ -136,7 +136,7 @@ def loadProject(self, filename):
continue
self.error += "\n%s '%s' not found" % (key, val)
#except AttributeError:
#print "loadProject AttributeError", self.error
#print "loadProject AttributeError", self.error
#self.error += (" in project '%s'") % (filename)
#return False
return True
Expand Down Expand Up @@ -170,23 +170,23 @@ def xmlGetTitleNodeRecursive(self, node, title_idx = -1):
print "[xmlGetTitleNodeRecursive]", title_idx, node
print node.childNodes
for subnode in node.childNodes:
print "xmlGetTitleNodeRecursive subnode:", subnode
if subnode.nodeType == xml.dom.minidom.Element.nodeType:
if subnode.tagName == 'title':
title_idx += 1
title = DVDTitle.DVDTitle(self)
self.titles.append(title)
self.xmlGetTitleNodeRecursive(subnode, title_idx)
if subnode.tagName == 'path':
print "path:", subnode.firstChild.data
filename = subnode.firstChild.data
self.titles[title_idx].addFile(filename.encode("utf-8"))
if subnode.tagName == 'properties':
self.xmlAttributesToConfig(node, self.titles[title_idx].properties)
if subnode.tagName == 'audiotracks':
self.xmlGetTitleNodeRecursive(subnode, title_idx)
if subnode.tagName == 'audiotrack':
print "audiotrack...", subnode.toxml()
print "xmlGetTitleNodeRecursive subnode:", subnode
if subnode.nodeType == xml.dom.minidom.Element.nodeType:
if subnode.tagName == 'title':
title_idx += 1
title = DVDTitle.DVDTitle(self)
self.titles.append(title)
self.xmlGetTitleNodeRecursive(subnode, title_idx)
if subnode.tagName == 'path':
print "path:", subnode.firstChild.data
filename = subnode.firstChild.data
self.titles[title_idx].addFile(filename.encode("utf-8"))
if subnode.tagName == 'properties':
self.xmlAttributesToConfig(node, self.titles[title_idx].properties)
if subnode.tagName == 'audiotracks':
self.xmlGetTitleNodeRecursive(subnode, title_idx)
if subnode.tagName == 'audiotrack':
print "audiotrack...", subnode.toxml()

def getSize(self):
totalsize = 0
Expand Down
4 changes: 2 additions & 2 deletions lib/python/Screens/MovieSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1994,8 +1994,8 @@ def deleteConfirmed(self, confirmed):
offline = serviceHandler.offlineOperations(current)
try:
if offline is None:
from enigma import eBackgroundFileEraser
eBackgroundFileEraser.getInstance().erase(os.path.realpath(current.getPath()))
from enigma import eBackgroundFileEraser
eBackgroundFileEraser.getInstance().erase(os.path.realpath(current.getPath()))
else:
if offline.deleteFromDisk(0):
raise Exception, "Offline delete failed"
Expand Down
10 changes: 5 additions & 5 deletions lib/python/Screens/RecordPaths.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def __init__(self, session):

self["setupActions"] = ActionMap(["SetupActions", "ColorActions", "MenuActions"],
{
"green": self.save,
"red": self.keyCancel,
"cancel": self.keyCancel,
"ok": self.ok,
"menu": self.closeRecursive,
"green": self.save,
"red": self.keyCancel,
"cancel": self.keyCancel,
"ok": self.ok,
"menu": self.closeRecursive,
}, -2)

def checkReadWriteDir(self, configele):
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Tools/Directories.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def fileCheck(f, mode='r'):
return fileExists(f, mode) and f

def fileHas(f, content, mode='r'):
return fileExists(f, mode) and content in open(f, mode).read()
return fileExists(f, mode) and content in open(f, mode).read()

def getRecordingFilename(basename, dirname = None):
# filter out non-allowed characters
Expand Down
68 changes: 34 additions & 34 deletions skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ def collectAttributes(skinAttributes, node, context, skin_path_prefix=None, igno
# Similar situation for a scrollbar in a listbox; when the scrollbar setting is applied after
# the size, a scrollbar will not be shown until the selection moves for the first time
if attrib == 'size':
size = value.encode("utf-8")
size = value.encode("utf-8")
elif attrib == 'position':
pos = value.encode("utf-8")
pos = value.encode("utf-8")
elif attrib == 'font':
font = value.encode("utf-8")
skinAttributes.append((attrib, font))
font = value.encode("utf-8")
skinAttributes.append((attrib, font))
else:
skinAttributes.append((attrib, value.encode("utf-8")))
if pos is not None:
Expand Down Expand Up @@ -788,7 +788,7 @@ def __str__(self):

class SkinContext:
def __init__(self, parent=None, pos=None, size=None, font=None):
if parent is not None:
if parent is not None:
if pos is not None:
pos, size = parent.parse(pos, size, font)
self.x, self.y = pos
Expand All @@ -799,26 +799,26 @@ def __init__(self, parent=None, pos=None, size=None, font=None):
self.w = None
self.h = None
def __str__(self):
return "Context (%s,%s)+(%s,%s) " % (self.x, self.y, self.w, self.h)
return "Context (%s,%s)+(%s,%s) " % (self.x, self.y, self.w, self.h)
def parse(self, pos, size, font):
if pos == "fill":
pos = (self.x, self.y)
size = (self.w, self.h)
self.w = 0
self.h = 0
if pos == "fill":
pos = (self.x, self.y)
size = (self.w, self.h)
self.w = 0
self.h = 0
else:
w,h = size.split(',')
w = parseCoordinate(w, self.w, 0, font)
h = parseCoordinate(h, self.h, 0, font)
if pos == "bottom":
pos = (self.x, self.y + self.h - h)
size = (self.w, h)
self.h -= h
pos = (self.x, self.y + self.h - h)
size = (self.w, h)
self.h -= h
elif pos == "top":
pos = (self.x, self.y)
size = (self.w, h)
self.h -= h
self.y += h
pos = (self.x, self.y)
size = (self.w, h)
self.h -= h
self.y += h
elif pos == "left":
pos = (self.x, self.y)
size = (w, self.h)
Expand All @@ -837,19 +837,19 @@ def parse(self, pos, size, font):
class SkinContextStack(SkinContext):
# A context that stacks things instead of aligning them
def parse(self, pos, size, font):
if pos == "fill":
pos = (self.x, self.y)
size = (self.w, self.h)
if pos == "fill":
pos = (self.x, self.y)
size = (self.w, self.h)
else:
w,h = size.split(',')
w = parseCoordinate(w, self.w, 0, font)
h = parseCoordinate(h, self.h, 0, font)
if pos == "bottom":
pos = (self.x, self.y + self.h - h)
size = (self.w, h)
pos = (self.x, self.y + self.h - h)
size = (self.w, h)
elif pos == "top":
pos = (self.x, self.y)
size = (self.w, h)
pos = (self.x, self.y)
size = (self.w, h)
elif pos == "left":
pos = (self.x, self.y)
size = (w, self.h)
Expand Down Expand Up @@ -922,7 +922,7 @@ def readSkin(screen, skin, names, desktop):

# now walk all widgets and stuff
def process_none(widget, context):
pass
pass

def process_widget(widget, context):
get_attr = widget.attrib.get
Expand Down Expand Up @@ -1057,20 +1057,20 @@ def process_panel(widget, context):
if layout == 'stack':
cc = SkinContextStack
else:
cc = SkinContext
cc = SkinContext
try:
c = cc(context, widget.attrib.get('position'), widget.attrib.get('size'), widget.attrib.get('font'))
except Exception, ex:
raise SkinError("Failed to create skincontext (%s,%s,%s) in %s: %s" % (widget.attrib.get('position'), widget.attrib.get('size'), widget.attrib.get('font'), context, ex) )
raise SkinError("Failed to create skincontext (%s,%s,%s) in %s: %s" % (widget.attrib.get('position'), widget.attrib.get('size'), widget.attrib.get('font'), context, ex) )
process_screen(widget, c)

processors = {
None: process_none,
"widget": process_widget,
"applet": process_applet,
"eLabel": process_elabel,
"ePixmap": process_epixmap,
"panel": process_panel
None: process_none,
"widget": process_widget,
"applet": process_applet,
"eLabel": process_elabel,
"ePixmap": process_epixmap,
"panel": process_panel
}

try:
Expand Down
4 changes: 2 additions & 2 deletions tools/host_tools/FormatConverter/lamedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def read(self):
versionstring = lines[0].split('/')
version = int(versionstring[1])
if 3 > version or 4 < version:
print "unsupported lamedb version"
return
print "unsupported lamedb version"
return

transpondersreading = False
sats = {}
Expand Down

0 comments on commit 3856ef5

Please sign in to comment.