update dm7080 hardware drivers (frontend / demux was broken in 20170409)
[opendreambox.git] / meta-opendreambox / recipes-dreambox / enigma2 / enigma2-4.3.1r1 / 0001-NimManager.py-whitspace-cleanups.patch
1 From d483d3cc6599edb6c53aa02ba55ccf8d948148ac Mon Sep 17 00:00:00 2001
2 From: ghost <andreas.monzner@dream-property.net>
3 Date: Fri, 24 Mar 2017 17:22:16 +0100
4 Subject: [PATCH 1/9] NimManager.py: whitspace cleanups
5
6 ---
7  usr/lib/enigma2/python/Components/NimManager.py | 74 ++++++++++++++++++-------------------
8  1 file changed, 36 insertions(+), 38 deletions(-)
9
10 diff --git a/usr/lib/enigma2/python/Components/NimManager.py b/usr/lib/enigma2/python/Components/NimManager.py
11 index 67322bf..a5fd81d 100644
12 --- a/usr/lib/enigma2/python/Components/NimManager.py
13 +++ b/usr/lib/enigma2/python/Components/NimManager.py
14 @@ -105,13 +105,13 @@ class SecConfigure:
15                                         sec.setVoltageMode(switchParam.HV)
16                                 sec.setToneMode(switchParam.HILO)
17                                 sec.setRotorPosNum(0) # USALS
18 -               
19 +
20                 sec.setLNBSlotMask(tunermask)
21  
22         def setSatposDepends(self, sec, nim1, nim2):
23                 print "tuner", nim1, "depends on satpos of", nim2
24                 sec.setTunerDepends(nim1, nim2)
25 -               
26 +
27         def linkInternally(self, slotid):
28                 nim = self.NimManager.getNim(slotid)
29                 nim.setInternalLink()
30 @@ -123,7 +123,7 @@ class SecConfigure:
31                 else:
32                         print "external link tuner", nim1, "to tuner", nim2
33                 sec.setTunerLinked(nim1, nim2)
34 -               
35 +
36         def getRoot(self, slotid, connto):
37                 visited = []
38                 while (self.NimManager.getNimConfig(connto).sat.configMode.value in ("satposdepends", "equal", "loopthrough")):
39 @@ -482,7 +482,7 @@ class SecConfigure:
40                                                 sec.setToneMode(switchParam.ON)
41                                         elif currSat.tonemode.value == "off":
42                                                 sec.setToneMode(switchParam.OFF)
43 -                                               
44 +
45                                         if not currSat.usals.value and x < 34:
46                                                 sec.setRotorPosNum(currSat.rotorposition.value)
47                                         else:
48 @@ -567,7 +567,7 @@ class NIM(object):
49                 if name is None:
50                         name = chr(ord('A') + self.slot)
51                 return name
52 -       
53 +
54         slot_input_name = property(getSlotInputName)
55  
56         def getSlotName(self):
57 @@ -581,38 +581,38 @@ class NIM(object):
58  
59         def getSlotID(self):
60                 return chr(ord('A') + self.slot)
61 -       
62 +
63         def getI2C(self):
64                 return self.i2c
65 -       
66 +
67         def hasOutputs(self):
68                 return self.has_outputs
69 -       
70 +
71         def internallyConnectableTo(self):
72                 return self.internally_connectable
73 -       
74 +
75         def setInternalLink(self):
76                 if self.internally_connectable is not None:
77                         print "setting internal link on frontend id", self.frontend_id
78                         with open("/proc/stb/frontend/%d/rf_switch" % self.frontend_id, "w") as f:
79                                 f.write("internal")
80 -               
81 +
82         def removeInternalLink(self):
83                 if self.internally_connectable is not None:
84                         print "removing internal link on frontend id", self.frontend_id
85                         with open("/proc/stb/frontend/%d/rf_switch" % self.frontend_id, "w") as f:
86                                 f.write("external")
87 -       
88 +
89         def isMultiType(self):
90                 return (len(self._types) > 1)
91 -       
92 +
93         def isEmpty(self):
94                 return self.__is_empty
95 -       
96 +
97         # empty tuners are supported!
98         def isSupported(self):
99                 return (self.frontend_id is not None) or self.__is_empty
100 -       
101 +
102         # returns dict {<slotid>: <type>}
103         def getMultiTypeList(self):
104                 return self._types
105 @@ -626,14 +626,14 @@ class NIM(object):
106  
107         def getFriendlyFullDescription(self):
108                 nim_text = self.slot_name + ": "
109 -                       
110 +
111                 if self.empty:
112                         nim_text += _("(empty)")
113                 elif not self.isSupported():
114                         nim_text += self.description + " (" + _("not supported") + ")"
115                 else:
116                         nim_text += self.description + " (" + self.friendly_type + ")"
117 -               
118 +
119                 return nim_text
120  
121         friendly_full_description = property(getFriendlyFullDescription)
122 @@ -675,7 +675,7 @@ class NimManager:
123  
124         def getTranspondersTerrestrial(self, region):
125                 return self.transpondersterrestrial[region]
126 -       
127 +
128         def getCableDescription(self, nim):
129                 return self.cablesList[config.Nims[nim].scan_provider.index][0]
130  
131 @@ -742,7 +742,7 @@ class NimManager:
132                 # NIM Socket 3:
133                 #          Type: DVB-S
134                 #          Name: Alps BSBE1 702A
135 -               
136 +
137                 #
138                 # Type will be either "DVB-S", "DVB-S2", "DVB-T", "DVB-C", "DVB-T2" or None.
139  
140 @@ -797,7 +797,7 @@ class NimManager:
141                                 entries[current_slot]["name"] = _("N/A")
142                                 entries[current_slot]["isempty"] = True
143                 nimfile.close()
144 -               
145 +
146                 for id, entry in entries.items():
147                         if not (entry.has_key("name") and entry.has_key("type")):
148                                 entry["name"] =  _("N/A")
149 @@ -825,24 +825,24 @@ class NimManager:
150  
151         def getNimTypes(self, slotid):
152                 return self.nim_slots[slotid].types.values()
153 -       
154 +
155         def getNimDescription(self, slotid):
156                 return self.nim_slots[slotid].friendly_full_description
157 -       
158 +
159         def getNimName(self, slotid):
160                 return self.nim_slots[slotid].description
161 -       
162 +
163         def getNimSlotInputName(self, slotid):
164                 # returns just "A", "B", ...
165                 return self.nim_slots[slotid].slot_input_name
166 -       
167 +
168         def getNimSlotName(self, slotid):
169                 # returns a friendly description string ("Tuner A", "Tuner B" etc.)
170                 return self.nim_slots[slotid].slot_name
171 -       
172 +
173         def getNim(self, slotid):
174                 return self.nim_slots[slotid]
175 -       
176 +
177         def getI2CDevice(self, slotid):
178                 return self.nim_slots[slotid].getI2C()
179  
180 @@ -877,19 +877,19 @@ class NimManager:
181                 for slot in self.nim_slots:
182                         list.append(slot.friendly_full_description)
183                 return list
184 -       
185 +
186         def getSlotCount(self):
187                 return len(self.nim_slots)
188 -       
189 +
190         def hasOutputs(self, slotid):
191                 return self.nim_slots[slotid].hasOutputs()
192 -       
193 +
194         def nimInternallyConnectableTo(self, slotid):
195                 return self.nim_slots[slotid].internallyConnectableTo()
196 -       
197 +
198         def nimRemoveInternalLink(self, slotid):
199                 self.nim_slots[slotid].removeInternalLink()
200 -       
201 +
202         def canConnectTo(self, slotid):
203                 slots = []
204                 internally_connectable = self.nimInternallyConnectableTo(slotid)
205 @@ -909,7 +909,7 @@ class NimManager:
206                 slots.sort()
207                 
208                 return slots
209 -       
210 +
211         def canEqualTo(self, slotid):
212                 nimList = self.getNimListForSlot(slotid)
213                 for nim in nimList[:]:
214 @@ -947,10 +947,10 @@ class NimManager:
215                                 if not alreadyConnected:
216                                         positionerList.append(nim)
217                 return positionerList
218 -       
219 +
220         def getNimConfig(self, slotid):
221                 return config.Nims[slotid]
222 -       
223 +
224         def getSatName(self, pos):
225                 for sat in self.satList:
226                         if sat[0] == pos:
227 @@ -959,7 +959,7 @@ class NimManager:
228  
229         def getSatList(self):
230                 return self.satList
231 -       
232 +
233         # returns True if something is configured to be connected to this nim
234         # if slotid == -1, returns if something is connected to ANY nim
235         def somethingConnected(self, slotid = -1):
236 @@ -1479,11 +1479,11 @@ def InitNimManager(nimmgr, slot_no = None):
237         positioner_mode_choices = [("usals", _("USALS")), ("manual", _("manual"))]
238  
239         diseqc_satlist_choices = [(3601, _('nothing connected'), 1)] + nimmgr.satList
240 -       
241 +
242         longitude_orientation_choices = [("east", _("East")), ("west", _("West"))]
243         latitude_orientation_choices = [("north", _("North")), ("south", _("South"))]
244         turning_speed_choices = [("fast", _("Fast")), ("slow", _("Slow")), ("fast epoch", _("Fast epoch"))]
245 -       
246 +
247         advanced_satlist_choices = nimmgr.satList + [
248                 (3601, _('All Satellites')+' 1', 1), (3602, _('All Satellites')+' 2', 1),
249                 (3603, _('All Satellites')+' 3', 1), (3604, _('All Satellites')+' 4', 1)]
250 @@ -1502,8 +1502,6 @@ def InitNimManager(nimmgr, slot_no = None):
251         advanced_lnb_fast_turning_btime = mktime(datetime(1970, 1, 1, 7, 0).timetuple());
252         advanced_lnb_fast_turning_etime = mktime(datetime(1970, 1, 1, 19, 0).timetuple());
253  
254 -
255 -       
256         def configDiSEqCModeChanged(configElement):
257                 section = configElement.section
258                 if configElement.value == "1_2" and isinstance(section.longitude, ConfigNothing):
259 -- 
260 2.1.4
261