Skip to content

Commit

Permalink
Merge remote-tracking branch 'e2/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Blackburn committed Dec 8, 2013
2 parents 4825376 + 178e281 commit 306f4ba
Show file tree
Hide file tree
Showing 29 changed files with 477 additions and 365 deletions.
2 changes: 2 additions & 0 deletions Makefile.am
Expand Up @@ -15,6 +15,7 @@ SUBDIRS = \
birthdayreminder \
bonjour \
cdinfo \
channelselectionshorttitle \
curlytx \
dreamexplorer \
dreamirc \
Expand All @@ -28,6 +29,7 @@ SUBDIRS = \
epgrefresh \
eurotictv \
eventlist \
eventposition \
filebrowser \
flashexpander \
fritzcall \
Expand Down
2 changes: 2 additions & 0 deletions channelselectionshorttitle/CONTROL/control
@@ -0,0 +1,2 @@
Description: ChannelSelectionShortTitle Converter
Depends: enigma2
1 change: 1 addition & 0 deletions channelselectionshorttitle/Makefile.am
@@ -0,0 +1 @@
SUBDIRS = src
39 changes: 39 additions & 0 deletions channelselectionshorttitle/src/ChannelSelectionShortTitle.py
@@ -0,0 +1,39 @@
#
# ChannelSelectionShortTitle - Converter
#
# Coded by Dr.Best (c) 2013
# Support: www.dreambox-tools.info
# E-Mail: dr.best@dreambox-tools.info
#
# This plugin is open source but it is NOT free software.
#
# This plugin may only be distributed to and executed on hardware which
# is licensed by Dream Multimedia GmbH.
# In other words:
# It's NOT allowed to distribute any parts of this plugin or its source code in ANY way
# to hardware which is NOT licensed by Dream Multimedia GmbH.
# It's NOT allowed to execute this plugin and its source code or even parts of it in ANY way
# on hardware which is NOT licensed by Dream Multimedia GmbH.
#
# If you want to use or modify the code or parts of it,
# you have to keep MY license and inform me about the modifications by mail.
#

from Components.Converter.Converter import Converter
from Components.Element import cached
from Components.config import config

class ChannelSelectionShortTitle(Converter, object):
def __init__(self, type):
Converter.__init__(self, type)

@cached
def getText(self):
title = self.source.text
t = " (%s) " % config.servicelist.lastmode.value.upper()
pos = title.find(t)
if pos != -1:
title = title[pos+len(t):]
return title

text = property(getText)
4 changes: 4 additions & 0 deletions channelselectionshorttitle/src/Makefile.am
@@ -0,0 +1,4 @@
installdir = $(libdir)/enigma2/python/Plugins/SkinComponents/ChannelSelectionShortTitle
converterinstalldir = $(libdir)/enigma2/python/Components/Converter
install_DATA = README
converterinstall_PYTHON = ChannelSelectionShortTitle.py
12 changes: 12 additions & 0 deletions channelselectionshorttitle/src/README
@@ -0,0 +1,12 @@
Description: ChannelSelectionShortTitle Converter
This converter truncates the original title of ChannelSelection --> "title (MODE)" will be cut off

Usage:
<widget backgroundColor="secondBG" font="Regular;24" position="70,5" render="Label" size="850,80" source="Title" transparent="1" valign="center" zPosition="1">
<convert type="ChannelSelectionShortTitle"/>
</widget>





6 changes: 6 additions & 0 deletions configure.ac
Expand Up @@ -256,6 +256,9 @@ cdinfo/Makefile
cdinfo/meta/Makefile
cdinfo/src/Makefile
channelselectionshorttitle/Makefile
channelselectionshorttitle/src/Makefile
curlytx/Makefile
curlytx/meta/Makefile
curlytx/po/Makefile
Expand Down Expand Up @@ -337,6 +340,9 @@ eurotictv/src/Makefile
eventlist/Makefile
eventlist/src/Makefile
eventposition/Makefile
eventposition/src/Makefile
fancontrol2/Makefile
fancontrol2/meta/Makefile
fancontrol2/po/Makefile
Expand Down
34 changes: 17 additions & 17 deletions eventlist/src/EventList.py
Expand Up @@ -54,23 +54,23 @@ def getContent(self):
return []
curEvent = self.source.getCurrentEvent()
if curEvent:
self.epgcache.startTimeQuery(eServiceReference(ref.toString()), curEvent.getBeginTime() + curEvent.getDuration())
i = 1
while i <= (self.eventcount):
event = self.epgcache.getNextTimeEntry()
if event is not None:
contentList.append(self.getEventTuple(event),)
i +=1
if self.primetime == 1:
now = localtime(time())
dt = datetime(now.tm_year, now.tm_mon, now.tm_mday, 20, 15)
if time() > mktime(dt.timetuple()):
dt += timedelta(days=1) # skip to next day...
primeTime = int(mktime(dt.timetuple()))
self.epgcache.startTimeQuery(eServiceReference(ref.toString()), primeTime)
event = self.epgcache.getNextTimeEntry()
if event and (event.getBeginTime() <= int(mktime(dt.timetuple()))):
contentList.append(self.getEventTuple(event),)
if not self.epgcache.startTimeQuery(eServiceReference(ref.toString()), curEvent.getBeginTime() + curEvent.getDuration()):
i = 1
while i <= (self.eventcount):
event = self.epgcache.getNextTimeEntry()
if event is not None:
contentList.append(self.getEventTuple(event),)
i +=1
if self.primetime == 1:
now = localtime(time())
dt = datetime(now.tm_year, now.tm_mon, now.tm_mday, 20, 15)
if time() > mktime(dt.timetuple()):
dt += timedelta(days=1) # skip to next day...
primeTime = int(mktime(dt.timetuple()))
if not self.epgcache.startTimeQuery(eServiceReference(ref.toString()), primeTime):
event = self.epgcache.getNextTimeEntry()
if event and (event.getBeginTime() <= int(mktime(dt.timetuple()))):
contentList.append(self.getEventTuple(event),)
return contentList

def getEventTuple(self,event):
Expand Down
2 changes: 2 additions & 0 deletions eventposition/CONTROL/control
@@ -0,0 +1,2 @@
Description: EventPosition Converter using ePositionGauge for event data
Depends: enigma2
1 change: 1 addition & 0 deletions eventposition/Makefile.am
@@ -0,0 +1 @@
SUBDIRS = src
72 changes: 72 additions & 0 deletions eventposition/src/EventPosition.py
@@ -0,0 +1,72 @@
# -*- coding: utf-8 -*-
#
# EventPosition - Converter
#
# Coded by Dr.Best (c) 2013
# Support: www.dreambox-tools.info
# E-Mail: dr.best@dreambox-tools.info
#
# This plugin is open source but it is NOT free software.
#
# This plugin may only be distributed to and executed on hardware which
# is licensed by Dream Multimedia GmbH.
# In other words:
# It's NOT allowed to distribute any parts of this plugin or its source code in ANY way
# to hardware which is NOT licensed by Dream Multimedia GmbH.
# It's NOT allowed to execute this plugin and its source code or even parts of it in ANY way
# on hardware which is NOT licensed by Dream Multimedia GmbH.
#
# If you want to use or modify the code or parts of it,
# you have to keep MY license and inform me about the modifications by mail.
#

from Converter import Converter
from Poll import Poll
from Components.Element import cached
from time import time

class EventPosition(Poll, Converter, object):
def __init__(self, type):
Poll.__init__(self)
Converter.__init__(self, type)
self.poll_interval = 30*1000
self.poll_enabled = True

@cached
def getPosition(self):
event = self.source.event
if event is None:
return None
now = int(time())
start_time = event.getBeginTime()
duration = event.getDuration()
if start_time <= now <= (start_time + duration) and duration > 0:
return now - start_time
else:
return 0

@cached
def getLength(self):
event = self.source.event
if event is None:
return None
return event.getDuration()

@cached
def getCutlist(self):
return []


position = property(getPosition)
length = property(getLength)
cutlist = property(getCutlist)


def changed(self, what):
if what[0] != self.CHANGED_CLEAR:
self.downstream_elements.changed(what)
if len(self.downstream_elements):
if not self.source.event and self.downstream_elements[0].visible:
self.downstream_elements[0].visible = False
elif self.source.event and not self.downstream_elements[0].visible:
self.downstream_elements[0].visible = True
4 changes: 4 additions & 0 deletions eventposition/src/Makefile.am
@@ -0,0 +1,4 @@
installdir = $(libdir)/enigma2/python/Plugins/SkinComponents/EventPosition
converterinstalldir = $(libdir)/enigma2/python/Components/Converter
install_DATA = README
converterinstall_PYTHON = EventPosition.py
12 changes: 12 additions & 0 deletions eventposition/src/README
@@ -0,0 +1,12 @@
Description: EventPosition Converter using ePositionGauge for event data

Usage example:

<widget pointer="Vali.HD.warp/shinybar.png:8,5" position="235,566" size="100,12" render="PositionGauge" source="session.Event_Now" transparent="1" zPosition="1">
<convert type="EventPosition"/>
</widget>





2 changes: 1 addition & 1 deletion fancontrol2/src/globals.py
@@ -1,5 +1,5 @@
from __init__ import _
Version = "V2.9r0"
Version = "V2.9r2"
# globale Variablen
ZielRPM = 0
AktVLT = 0
Expand Down
3 changes: 2 additions & 1 deletion fancontrol2/src/plugin.py
Expand Up @@ -163,7 +163,7 @@ def setPWM(fanid, value):
config.plugins.FanControl.MonitorInExtension = ConfigYesNo(default = True)
config.plugins.FanControl.FanControlInExtension = ConfigYesNo(default = True)
config.plugins.FanControl.Multi = ConfigSelection(choices = [("1", "RPM"), ("2", "RPM/2")], default = "2")
config.plugins.FanControl.EnableThread = ConfigYesNo(default = False)
config.plugins.FanControl.EnableThread = ConfigYesNo(default = True)

def GetFanRPM():
global RPMread
Expand Down Expand Up @@ -944,6 +944,7 @@ def __init__(self,session):
self.dontshutdown = False
self.Recording = False
self.inStandby = False
self.HDDidle = True
# RPM PI controller initialization - later
self.RPMController.timer_delay = 10.0
self.RPMController.dt = 10.0
Expand Down
15 changes: 8 additions & 7 deletions fritzcall/src/FritzCallFBF.py
Expand Up @@ -2,9 +2,9 @@
'''
Created on 30.09.2012
$Author: michael $
$Revision: 808 $
$Date: 2013-09-29 18:19:57 +0200 (Sun, 29 Sep 2013) $
$Id: FritzCallFBF.py 808 2013-09-29 16:19:57Z michael $
$Revision: 822 $
$Date: 2013-11-30 16:42:31 +0100 (Sat, 30 Nov 2013) $
$Id: FritzCallFBF.py 822 2013-11-30 15:42:31Z michael $
'''

# C0111 (Missing docstring)
Expand Down Expand Up @@ -73,7 +73,7 @@ def cleanNumber(number):
number = number.replace('(','').replace(')','').replace(' ','').replace('-','')
if number[0] == '+':
number = '00' + number[1:]
if number.startswith(config.plugins.FritzCall.country.value):
if config.plugins.FritzCall.country.value and number.startswith(config.plugins.FritzCall.country.value):
number = '0' + number[len(config.plugins.FritzCall.country.value):]
return number

Expand Down Expand Up @@ -1371,17 +1371,18 @@ def _parseFritzBoxPhonebook(self, html):
debug("[FritzCallFBF_05_50] _parseFritzBoxPhonebook: Ignoring entry with empty number for '''%s'''" % (__(name)))
continue
else:
thisname = name
thisname = name.decode('utf-8')
if config.plugins.FritzCall.showType.value and thistypes[i]:
thisname = thisname + " (" + thistypes[i] + ")"
thisname = thisname + " (" + thistypes[i].decode('utf-8') + ")"
if config.plugins.FritzCall.showShortcut.value and thiscodes[i]:
thisname = thisname + ", " + _("Shortcut") + ": " + thiscodes[i]
if config.plugins.FritzCall.showVanity.value and thisvanitys[i]:
thisname = thisname + ", " + _("Vanity") + ": " + thisvanitys[i]

# debug("[FritzCallFBF_05_50] _parseFritzBoxPhonebook: Adding '''%s''' with '''%s'''" % (__(thisname.strip()), __(thisnumber, False)))
# debug("[FritzCallFBF_05_50] _parseFritzBoxPhonebook: Adding '''%s''' with '''%s'''" % (thisname.strip(), thisnumber))
# Beware: strings in phonebook.phonebook have to be in utf-8!
self.phonebook.phonebook[thisnumber] = thisname
self.phonebook.phonebook[thisnumber] = thisname.encode('utf-8')
else:
self._notify(_("Could not parse FRITZ!Box Phonebook entry"))

Expand Down
25 changes: 10 additions & 15 deletions fritzcall/src/nrzuname.py
@@ -1,10 +1,10 @@
#!/usr/bin/python
# -*- coding: UTF-8 -*-
'''
$Id: nrzuname.py 800 2013-07-21 12:34:08Z michael $
$Id: nrzuname.py 824 2013-12-02 16:56:32Z michael $
$Author: michael $
$Revision: 800 $
$Date: 2013-07-21 14:34:08 +0200 (Sun, 21 Jul 2013) $
$Revision: 824 $
$Date: 2013-12-02 17:56:32 +0100 (Mon, 02 Dec 2013) $
'''

# W0603 (global statement); W0141 (map, filter, etc.)
Expand Down Expand Up @@ -161,10 +161,10 @@ def __init__(self, number, outputFunction=out, charset="cp1252", countrycode = "

self.countrycode = countrycode

if re.match('^\+', self.number):
if re.match(r'^\+', self.number):
self.number = '00' + self.number[1:]

if self.number[:len(countrycode)] == countrycode:
if countrycode and self.number[:len(countrycode)] == countrycode:
self.number = '0' + self.number[len(countrycode):]

if number[0] != "0":
Expand All @@ -173,6 +173,7 @@ def __init__(self, number, outputFunction=out, charset="cp1252", countrycode = "
return

if self.number[:2] == "00":
debug("[ReverseLookupAndNotifier] number %s, %s" %(self.number, self.number[:4]))
if countries.has_key(self.number[:3]): # e.g. USA
self.countrycode = self.number[:3]
elif countries.has_key(self.number[:4]):
Expand All @@ -185,16 +186,10 @@ def __init__(self, number, outputFunction=out, charset="cp1252", countrycode = "
self.notifyAndReset()
return

if countries.has_key(self.countrycode):
debug("[ReverseLookupAndNotifier] Found website for reverse lookup")
self.websites = countries[self.countrycode]
self.nextWebsiteNo = 1
self.handleWebsite(self.websites[0])
else:
debug("[ReverseLookupAndNotifier] Country cannot be reverse handled")
# self.caller = _("UNKNOWN")
self.notifyAndReset()
return
debug("[ReverseLookupAndNotifier] Found website for reverse lookup")
self.websites = countries[self.countrycode]
self.nextWebsiteNo = 1
self.handleWebsite(self.websites[0])

def handleWebsite(self, website):
debug("[ReverseLookupAndNotifier] handleWebsite: " + website.getAttribute("name"))
Expand Down

0 comments on commit 306f4ba

Please sign in to comment.