Source.__init__(self)
self.session = session
-# self.session.nav.event.append(self.checkSubservicesAvail) # we like to get service events
-#
-# def checkSubservicesAvail(self, ev):
-# if ev == iPlayableService.evUpdatedEventInfo:
-# service = self.session.nav.getCurrentService()
-# subservices = service and service.subServices()
-# if subservices or subservices.getNumberOfSubservices() == 0:
-# self["SubserviceQuickzapAction"].setEnabled(False)
-
def command(self):
print "SubServices was called"
list = []
n = subservices and subservices.getNumberOfSubservices()
for x in range(n):
sub = subservices.getSubservice(x)
- list.append([sub.toString() , sub.getName()])
+ list.append([sub.toString(), sub.getName()])
else:
list.append(["N/A", "N/A"])
return txt.replace(/'/g, "\\'").replace(/"/g, '"');
}
+function addLeadingZero(nr){
+ if(nr < 10){
+ return '0' + nr;
+ }
+ return nr;
+}
function dateToString(date){
var dateString = "";
dateString += date.getFullYear();
- dateString += "-" + date.getMonth();
- dateString += "-" + date.getDate();
-
- var hours = date.getHours();
- if(hours < 10){
- hours = '0' + hours;
- }
- dateString += " " + hours;
-
- var minutes = date.getMinutes();
- if(minutes < 10){
- minutes = '0' + minutes;
- }
- dateString += ":" + minutes;
-
+ dateString += "-" + addLeadingZero(date.getMonth()+1);
+ dateString += "-" + addLeadingZero(date.getDate());
+ dateString += " " + addLeadingZero(date.getHours());
+ dateString += ":" + addLeadingZero(date.getMinutes());
+
return dateString;
}