#include <lib/base/encoding.h>
#include <lib/base/estring.h>
+std::string buildShortName( const std::string &str )
+{
+ std::string tmp;
+ static char stropen[3] = { 0xc2, 0x86, 0x00 };
+ static char strclose[3] = { 0xc2, 0x87, 0x00 };
+ unsigned int open=std::string::npos-1;
+ while ( (open = str.find(stropen, open+2)) != std::string::npos )
+ {
+ unsigned int close = str.find(strclose, open);
+ if ( close != std::string::npos )
+ {
+ tmp+=str.substr( open+2, close-(open+2) );
+ eDebug("now %s", tmp.c_str());
+ }
+ }
+ return tmp.length() ? tmp : str;
+}
+
std::string getNum(int val, int sys)
{
// Returns a string that contain the value val as string
#include <stdio.h>
#include "eerror.h"
+std::string buildShortName( const std::string &str );
+
int strnicmp(const char*, const char*, int);
std::string getNum(int num, int base=10);
#include <sys/vfs.h> // for statfs
// #include <libmd5sum.h>
#include <lib/base/eerror.h>
+#include <lib/base/estring.h>
#include <lib/dvb/pmt.h>
#include <lib/dvb/db.h>
#include <lib/python/python.h>
tmp = service;
inc_refcount = true;
break;
+ case 'n': // short service name
case 'N': // service name
tmp = service_name;
inc_refcount = true;
// C = Current Time
// R = Service Reference
// N = Service Name
+// n = Short Service Name
// then for each service follows a tuple
// first tuple entry is the servicereference (as string... use the ref.toString() function)
// the second is the type of query
PyLong_FromLong(eDVBLocalTimeHandler::getInstance()->nowTime()) :
ePyObject();
- bool must_get_service_name = strchr(argstring, 'N') ? true : false;
+ int must_get_service_name = strchr(argstring, 'N') ? 1 : strchr(argstring, 'n') ? 2 : 0;
// create dest list
ePyObject dest_list=PyList_New(0);
{
std::string name;
sptr->getName(ref, name);
+
+ if (must_get_service_name == 1)
+ {
+ unsigned int pos;
+ // filter short name brakets
+ while((pos = name.find("\xc2\x86")) != std::string::npos)
+ name.erase(pos,2);
+ while((pos = name.find("\xc2\x87")) != std::string::npos)
+ name.erase(pos,2);
+ }
+ else
+ name = buildShortName(name);
+
if (name.length())
service_name = PyString_FromString(name.c_str());
}
tmp = service_reference;
inc_refcount = true;
break;
+ case 'n': // short service name
case 'N': // service name
tmp = service_name;
inc_refcount = true;
// E = Event Extended Description
// R = Service Reference
// N = Service Name
+// n = Short Service Name
// the second tuple entry is the MAX matches value
// the third tuple entry is the type of query
// 0 = search for similar broadcastings (SIMILAR_BROADCASTINGS_SEARCH)
eDebug("event not found !!!!!!!!!!!");
}
// create service name
- if (!service_name && strchr(argstring,'N'))
+ if (!service_name)
{
- ePtr<iStaticServiceInformation> sptr;
- eServiceCenterPtr service_center;
- eServiceCenter::getPrivInstance(service_center);
- if (service_center)
+ int must_get_service_name = strchr(argstring, 'N') ? 1 : strchr(argstring, 'n') ? 2 : 0;
+ if (must_get_service_name)
{
- service_center->info(ref, sptr);
- if (sptr)
+ ePtr<iStaticServiceInformation> sptr;
+ eServiceCenterPtr service_center;
+ eServiceCenter::getPrivInstance(service_center);
+ if (service_center)
{
- std::string name;
- sptr->getName(ref, name);
- if (name.length())
- service_name = PyString_FromString(name.c_str());
+ service_center->info(ref, sptr);
+ if (sptr)
+ {
+ std::string name;
+ sptr->getName(ref, name);
+
+ if (must_get_service_name == 1)
+ {
+ unsigned int pos;
+ // filter short name brakets
+ while((pos = name.find("\xc2\x86")) != std::string::npos)
+ name.erase(pos,2);
+ while((pos = name.find("\xc2\x87")) != std::string::npos)
+ name.erase(pos,2);
+ }
+ else
+ name = buildShortName(name);
+
+ if (name.length())
+ service_name = PyString_FromString(name.c_str());
+ }
}
+ if (!service_name)
+ service_name = PyString_FromString("<n/a>");
}
- if (!service_name)
- service_name = PyString_FromString("<n/a>");
}
// create servicereference string
if (!service_reference && strchr(argstring,'R'))
+# -*- coding: utf-8 -*-
from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService
from Components.Element import cached
return ""
if self.type == self.NAME:
- return info.getName()
+ return info.getName().replace('\xc2\x86', '').replace('\xc2\x87', '')
elif self.type == self.PROVIDER:
return self.getServiceInfoValue(info, iServiceInformation.sProvider)
-# -*- coding: utf-8 -*-
from HTMLComponent import *
from GUIComponent import *
def buildMultiEntry(self, changecount, service, eventId, begTime, duration, EventName, nowTime, service_name):
rec=begTime and (self.timer.isInTimer(eventId, begTime, duration, service) > ((duration/10)*8))
- sname = service_name
r1=self.service_rect
r2=self.progress_rect
r3=self.descr_rect
r4=self.start_end_rect
res = [ None ] # no private data needed
- re = compile('\xc2\x86.*?\xc2\x87')
- list = re.findall(sname)
- if len(list):
- sname=''
- for substr in list:
- sname+=substr[2:len(substr)-2]
- if len(sname) == 0:
- sname = service_name;
if rec:
- res.append((eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width()-21, r1.height(), 0, RT_HALIGN_LEFT, sname))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width()-21, r1.height(), 0, RT_HALIGN_LEFT, service_name))
res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r1.left()+r1.width()-16, r1.top(), 21, 21, loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, 'epgclock-fs8.png'))))
else:
- res.append((eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_LEFT, sname))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_LEFT, service_name))
if begTime is not None:
if nowTime < begTime:
begin = localtime(begTime)
def fillMultiEPG(self, services, stime=-1):
t = time()
- test = [ '0RIBDTCN' ]
+ test = [ '0RIBDTCn' ]
for service in services:
tuple = (service.ref.toString(), 0, stime)
test.append( tuple )
def updateMultiEPG(self, direction):
t = time()
- test = [ 'RIBDTCN' ]
+ test = [ 'RIBDTCn' ]
for x in self.list:
service = x[1]
begTime = x[3]
if (!service_center->info(parent, service_info))
{
if (!service_info->getName(parent, name))
- {
- // just show short name
- unsigned int pos = name.find("\xc2\x86");
- if ( pos != std::string::npos )
- name.erase(0, pos+2);
- pos = name.find("\xc2\x87");
- if ( pos != std::string::npos )
- name.erase(pos);
- name+=" - ";
- }
+ name=buildShortName(name) + " - ";
}
}
}
// S = Service Reference (as python string object .. same as ref.toString())
// C = Service Reference (as python string object .. same as ref.toCompareString())
// N = Service Name (as python string object)
+// n = Short Service Name (short name brakets used) (as python string object)
// when exactly one return value per service is selected in the format string,
// then each value is directly a list entry
// when more than one value is returned per service, then the list is a list of
ePtr<iStaticServiceInformation> sptr;
eServiceCenterPtr service_center;
- if (strchr(format, 'N'))
+ if (strchr(format, 'N') || strchr(format, 'n'))
eServiceCenter::getPrivInstance(service_center);
ret = PyList_New(services);
{
std::string name;
sptr->getName(ref, name);
+
+ // filter short name brakets
+ unsigned int pos;
+ while((pos = name.find("\xc2\x86")) != std::string::npos)
+ name.erase(pos,2);
+ while((pos = name.find("\xc2\x87")) != std::string::npos)
+ name.erase(pos,2);
+
+ if (name.length())
+ tmp = PyString_FromString(name.c_str());
+ }
+ }
+ if (!tmp)
+ tmp = PyString_FromString("<n/a>");
+ break;
+ case 'n': // short service name
+ if (service_center)
+ {
+ service_center->info(ref, sptr);
+ if (sptr)
+ {
+ std::string name;
+ sptr->getName(ref, name);
+ name = buildShortName(name);
if (name.length())
tmp = PyString_FromString(name.c_str());
}