-from enigma import *
+from enigma import eServiceCenter, eServiceReference, pNavigation
from Components.ParentalControl import parentalControl
from Tools.BoundFunction import boundFunction
import RecordTimer
-
-from enigma import *
+from enigma import eServiceReference, eServiceCenter
import NavigationInstance
def readKeymap():
- p = enigma.eActionMapPtr()
- enigma.eActionMap.getInstance(p)
+ p = enigma.eActionMap.getInstance()
assert p
filename1 = "data/keymap.xml"
return 0;
}
-#if 0
-void eActionMap::getInstance(eActionMap **ptr)
-{
- *ptr = instance;
-}
-#endif
-
void eActionMap::bindAction(const std::string &context, int priority, int id, eWidget *widget)
{
eActionBinding bnd;
}
}
+ePtr<eActionMap> NewActionMapPtr(void)
+{
+ ePtr<eActionMap> ptr;
+ eActionMap::getInstance(ptr);
+ return ptr;
+}
+
eAutoInitPtr<eActionMap> init_eActionMap(eAutoInitNumbers::actions, "eActionMap");
class eWidget;
+SWIG_IGNORE(eActionMap);
class eActionMap: public iObject
{
DECLARE_REF(eActionMap);
void keyPressed(const std::string &device, int key, int flags);
- static RESULT getInstance(ePtr<eActionMap> &ptr);
#ifndef SWIG
+ static RESULT getInstance(ePtr<eActionMap> &);
private:
static eActionMap *instance;
struct eActionBinding
std::multimap<std::string, ePythonKeyBinding> m_python_keys;
#endif
};
+SWIG_TEMPLATE_TYPEDEF_REPLACE(ePtr<eActionMap>, eActionMap);
+SWIG_EXTEND(ePtr<eActionMap>,
+ static ePtr<eActionMap> getInstance()
+ {
+ extern ePtr<eActionMap> NewActionMapPtr(void);
+ return NewActionMapPtr();
+ }
+);
#endif
#ifndef __ebase_h
#define __ebase_h
+#ifndef SWIG
#include <vector>
#include <map>
#include <sys/poll.h>
#include <time.h>
#include <lib/base/eptrlist.h>
-#include <lib/python/connections.h>
#include <libsig_comp.h>
+#endif
+
+#include <lib/python/connections.h>
class eApplication;
#include "etimezone.h"
-
#include <time.h>
-etimezone::etimezone()
+void e_tzset()
{
tzset();
}
#ifndef __etimezone_h
#define __etimezone_h
-class etimezone
-{
-public:
- etimezone();
-};
+void e_tzset(void);
#endif
#define __db_h
#ifndef SWIG
-#include <lib/base/eptrlist.h>
#include <lib/dvb/idvb.h>
+#include <lib/base/eptrlist.h>
#include <set>
class ServiceDescriptionSection;
#endif
return -1;
}
+ePtr<eDVBResourceManager> NewResourceManagerPtr(void)
+{
+ ePtr<eDVBResourceManager> ptr;
+ eDVBResourceManager::getInstance(ptr);
+ return ptr;
+}
+
eDVBResourceManager::eDVBResourceManager()
:m_releaseCachedChannelTimer(eApp)
{
eSmartPtrList<eDVBFrontend> m_frontend;
eSmartPtrList<eDVBDemux> m_demux;
};
-
#endif // SWIG
+SWIG_IGNORE(eDVBResourceManager);
class eDVBResourceManager: public iObject, public Object
{
DECLARE_REF(eDVBResourceManager);
errNoDemux = -2,
errChidNotFound = -3
};
-
+
RESULT connectChannelAdded(const Slot1<void,eDVBChannel*> &channelAdded, ePtr<eConnection> &connection);
int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore);
/* allocate channel... */
RESULT allocateChannel(const eDVBChannelID &channelid, eUsePtr<iDVBChannel> &channel);
RESULT allocatePVRChannel(eUsePtr<iDVBPVRChannel> &channel);
+ static SWIG_VOID(RESULT) getInstance(ePtr<eDVBResourceManager> &SWIG_OUTPUT);
#ifdef SWIG
public:
#endif
PSignal1<void,int> frontendUseMaskChanged;
- RESULT allocateRawChannel(eUsePtr<iDVBChannel> &, int frontend_index);
- static RESULT getInstance(ePtr<eDVBResourceManager> &);
+ SWIG_VOID(RESULT) allocateRawChannel(eUsePtr<iDVBChannel> &SWIG_OUTPUT, int frontend_index);
};
-TEMPLATE_TYPEDEF(ePtr<eDVBResourceManager>, eDVBResourceManagerPtr);
-#ifndef SWIG
+SWIG_TEMPLATE_TYPEDEF_REPLACE(ePtr<eDVBResourceManager>, eDVBResourceManager);
+SWIG_EXTEND(ePtr<eDVBResourceManager>,
+ static ePtr<eDVBResourceManager> getInstance()
+ {
+ extern ePtr<eDVBResourceManager> NewResourceManagerPtr(void);
+ return NewResourceManagerPtr();
+ }
+);
+#ifndef SWIG
/* iDVBPVRChannel includes iDVBChannel. don't panic. */
class eDVBChannel: public iDVBPVRChannel, public iFilePushScatterGather, public Object
{
void AddUse();
void ReleaseUse();
};
-
#endif // SWIG
+
#endif
class iDVBSatelliteEquipmentControl;
class eSecCommandList;
-class iDVBFrontend: public iObject
+class iDVBFrontend_ENUMS
+{
+#ifdef SWIG
+ iDVBFrontend_ENUMS();
+ ~iDVBFrontend_ENUMS();
+#endif
+public:
+ enum { feSatellite, feCable, feTerrestrial };
+ enum { stateIdle, stateTuning, stateFailed, stateLock, stateLostLock };
+ enum { toneOff, toneOn };
+ enum { voltageOff, voltage13, voltage18, voltage13_5, voltage18_5 };
+ enum { bitErrorRate, signalPower, signalQuality, locked, synced, frontendNumber };
+};
+
+SWIG_IGNORE(iDVBFrontend);
+class iDVBFrontend: public iDVBFrontend_ENUMS, public iObject
{
public:
- enum {
- feSatellite, feCable, feTerrestrial
- };
virtual RESULT getFrontendType(int &SWIG_OUTPUT)=0;
virtual RESULT tune(const iDVBFrontendParameters &where)=0;
#ifndef SWIG
virtual RESULT connectStateChange(const Slot1<void,iDVBFrontend*> &stateChange, ePtr<eConnection> &connection)=0;
#endif
- enum {
- stateIdle = 0,
- stateTuning = 1,
- stateFailed = 2,
- stateLock = 3,
- stateLostLock = 4,
- };
virtual RESULT getState(int &SWIG_OUTPUT)=0;
- enum {
- toneOff, toneOn
- };
virtual RESULT setTone(int tone)=0;
- enum {
- voltageOff, voltage13, voltage18, voltage13_5, voltage18_5
- };
virtual RESULT setVoltage(int voltage)=0;
virtual RESULT sendDiseqc(const eDVBDiseqcCommand &diseqc)=0;
virtual RESULT sendToneburst(int burst)=0;
virtual RESULT setSEC(iDVBSatelliteEquipmentControl *sec)=0;
virtual RESULT setSecSequence(const eSecCommandList &list)=0;
#endif
- enum {
- bitErrorRate, signalPower, signalQuality, locked, synced, frontendNumber
- };
virtual int readFrontendData(int type)=0;
virtual PyObject *readTransponderData(bool original)=0;
-
#ifndef SWIG
virtual RESULT getData(int num, int &data)=0;
virtual RESULT setData(int num, int val)=0;
virtual int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm)=0;
#endif
};
-TEMPLATE_TYPEDEF(ePtr<iDVBFrontend>, iDVBFrontendPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<iDVBFrontend>, iDVBFrontendPtr);
#ifndef SWIG
class iDVBSatelliteEquipmentControl: public iObject
};
#endif // SWIG
+SWIG_IGNORE(iDVBChannel);
class iDVBChannel: public iObject
{
public:
+ /* direct frontend access for raw channels and/or status inquiries. */
+ virtual SWIG_VOID(RESULT) getFrontend(ePtr<iDVBFrontend> &SWIG_OUTPUT)=0;
+#ifndef SWIG
enum
{
state_idle, /* not yet tuned */
state_last_instance, /* just one reference to this channel is left */
state_release /* channel is being shut down. */
};
- virtual RESULT getState(int &SWIG_OUTPUT)=0;
-
- /* direct frontend access for raw channels and/or status inquiries. */
- virtual RESULT getFrontend(ePtr<iDVBFrontend> &)=0;
+ virtual RESULT getState(int &SWIG_OUTPUT)=0;
-#ifndef SWIG
virtual RESULT getCurrentFrontendParameters(ePtr<iDVBFrontendParameters> &)=0;
enum
{
virtual void ReleaseUse() = 0;
#endif
};
-TEMPLATE_TYPEDEF(eUsePtr<iDVBChannel>, iDVBChannelPtr);
+SWIG_TEMPLATE_TYPEDEF(eUsePtr<iDVBChannel>, iDVBChannelPtr);
#ifndef SWIG
-
/* signed, so we can express deltas. */
typedef long long pts_t;
class gRegion;
+SWIG_IGNORE(gPixmap);
class gPixmap: public iObject
{
DECLARE_REF(gPixmap);
public:
+#ifndef SWIG
enum
{
blitAlphaTest=1,
blitAlphaBlend=2
};
-#ifndef SWIG
gPixmap(gSurface *surface);
gPixmap(eSize, int bpp, int accel = 0);
gPixmap *lock();
void unlock();
+ inline bool needClut() const { return surface && surface->bpp <= 8; }
#endif
virtual ~gPixmap();
-
eSize size() const { return eSize(surface->x, surface->y); }
- inline bool needClut() const { return surface && surface->bpp <= 8; }
private:
bool must_delete_surface;
-#ifndef SWIG
friend class gDC;
void fill(const gRegion &clip, const gColor &color);
void fill(const gRegion &clip, const gRGB &color);
void mergePalette(const gPixmap &target);
void line(const gRegion &clip, ePoint start, ePoint end, gColor color);
-#else
+#ifdef SWIG
gPixmap();
#endif
-
};
-
-TEMPLATE_TYPEDEF(ePtr<gPixmap>, gPixmapPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<gPixmap>, gPixmapPtr);
#endif
std::map<int, ePtr<gFont> > m_font;
};
+#ifdef SWIG
+#define RT_HALIGN_LEFT 0
+#define RT_HALIGN_RIGHT 1
+#define RT_HALIGN_CENTER 2
+#define RT_HALIGN_BLOCK 4
+#define RT_VALIGN_TOP 0
+#define RT_VALIGN_CENTER 8
+#define RT_VALIGN_BOTTOM 16
+#define RT_WRAP 32
+#endif // SWIG
+
#endif
void destruct();
- int getStyle(ePtr<eWindowStyle> &style) { if (!m_style) return 1; style = m_style; return 0; }
+ SWIG_VOID(int) getStyle(ePtr<eWindowStyle> &SWIG_NAMED_OUTPUT(style)) { if (!m_style) return 1; style = m_style; return 0; }
void setStyle(eWindowStyle *style) { m_style = style; }
void setBackgroundColor(const gRGB &col);
DEFINE_REF(eWindowStyleManager);
+ePtr<eWindowStyleManager> NewWindowStylePtr(void)
+{
+ ePtr<eWindowStyleManager> ptr;
+ eWindowStyleManager::getInstance(ptr);
+ return ptr;
+}
+
eWindowStyleManager::eWindowStyleManager()
{
m_instance = this;
#include <lib/base/object.h>
+SWIG_IGNORE(eWindowStyle);
class eWindowStyle: public iObject
{
+#ifdef SWIG
+ eWindowStyle();
+#endif
public:
+#ifndef SWIG
virtual void handleNewSize(eWindow *wnd, eSize &size, eSize &offset) = 0;
virtual void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) = 0;
virtual void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) = 0;
virtual void setStyle(gPainter &painter, int what) = 0;
+ virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
+ virtual RESULT getFont(int what, ePtr<gFont> &font) = 0;
+#endif
+ virtual ~eWindowStyle() = 0;
enum {
styleLabel,
styleListboxSelected,
styleListboxMarkedAndSelected
};
- virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
-
enum {
frameButton,
frameListboxEntry
fontButton,
fontTitlebar
};
-
- virtual RESULT getFont(int what, ePtr<gFont> &font) = 0;
- virtual ~eWindowStyle() = 0;
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<eWindowStyle>, eWindowStylePtr);
+SWIG_IGNORE(eWindowStyleManager);
class eWindowStyleManager: public iObject
{
DECLARE_REF(eWindowStyleManager);
eWindowStyleManager();
~eWindowStyleManager();
#endif
- void getStyle(int style_id, ePtr<eWindowStyle> &style);
+ void getStyle(int style_id, ePtr<eWindowStyle> &SWIG_OUTPUT);
void setStyle(int style_id, eWindowStyle *style);
- static int getInstance(ePtr<eWindowStyleManager> &mgr) { mgr = m_instance; if (!mgr) return -1; return 0; }
+ static SWIG_VOID(int) getInstance(ePtr<eWindowStyleManager> &SWIG_NAMED_OUTPUT(mgr)) { mgr = m_instance; if (!mgr) return -1; return 0; }
private:
static eWindowStyleManager *m_instance;
std::map<int, ePtr<eWindowStyle> > m_current_style;
};
+SWIG_TEMPLATE_TYPEDEF_REPLACE(ePtr<eWindowStyleManager>, eWindowStyleManager);
+SWIG_EXTEND(ePtr<eWindowStyleManager>,
+ static ePtr<eWindowStyleManager> getInstance()
+ {
+ extern ePtr<eWindowStyleManager> NewWindowStylePtr(void);
+ return NewWindowStylePtr();
+ }
+);
-TEMPLATE_TYPEDEF(ePtr<eWindowStyleManager>, eWindowStyleManagerPtr);
-
+#ifndef SWIG
class eWindowStyleSimple: public eWindowStyle
{
DECLARE_REF(eWindowStyleSimple);
void drawFrame(gPainter &painter, const eRect &frame, int what);
RESULT getFont(int what, ePtr<gFont> &font);
};
+#endif
#endif
DECLARE_REF(eWindowStyleSkinned);
public:
eWindowStyleSkinned();
+#ifndef SWIG
void handleNewSize(eWindow *wnd, eSize &size, eSize &offset);
void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title);
void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size);
- void setStyle(gPainter &painter, int what);
void drawFrame(gPainter &painter, const eRect &frame, int what);
RESULT getFont(int what, ePtr<gFont> &font);
+#endif
+ void setStyle(gPainter &painter, int what);
enum {
bsWindow,
from config import config, ConfigSelection, ConfigYesNo, ConfigEnableDisable, ConfigSubsection, ConfigBoolean
import os
-from enigma import *
+from enigma import eAVSwitch
class AVSwitch:
INPUT = { "ENCODER": (0, 4), "SCART": (1, 3), "AUX": (2, 4) }
-from Tools.Directories import *
+from Tools.Directories import resolveFilename, SCOPE_SYSETC
class About:
def __init__(self):
-from enigma import *
+from enigma import eActionMap
class ActionMap:
def __init__(self, contexts = [ ], actions = { }, prio=0):
self.actions = actions
self.contexts = contexts
self.prio = prio
- self.p = eActionMapPtr()
+ self.p = eActionMap.getInstance()
self.bound = False
self.exec_active = False
self.enabled = True
- eActionMap.getInstance(self.p)
-
+
def setEnabled(self, enabled):
self.enabled = enabled
self.checkBind()
from HTMLComponent import *
from GUIComponent import *
-
from MenuList import MenuList
-
-from Tools.Directories import *
-
-from enigma import *
-
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
+from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename
+from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, eListbox, gFont, loadPNG
def ChoiceEntryComponent(key, text):
res = [ text ]
from GUIComponent import *
from VariableText import *
-#from enigma import eTimer
-#from enigma import eLabel
-
-from enigma import *
+from enigma import eTimer, eLabel
import time
# now some "real" components:
-import skin
from GUIComponent import *
-
-from enigma import *
+from enigma import eTimer
class ConditionalWidget(GUIComponent):
def __init__(self, withTimer = True):
if self.visible:
self.hide()
self.timer.stop()
-
+
class BlinkingWidgetConditional(BlinkingWidget, ConditionalWidget):
def __init__(self):
BlinkingWidget.__init__(self)
from HTMLComponent import *
from GUIComponent import *
-from enigma import *
+from enigma import eEPGCache, eListbox, eListboxPythonMultiContent, gFont, loadPNG, \
+ RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, RT_VALIGN_CENTER
+
from re import *
from time import localtime, time
from ServiceReference import ServiceReference
EPG_TYPE_MULTI = 1
EPG_TYPE_SIMILAR = 2
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
-
-RT_WRAP = 32
-
class Rect:
def __init__(self, x, y, width, height):
self.__left = x
from GUIComponent import *
import re
+from os import path as os_path, listdir
from MenuList import MenuList
from Components.Harddisk import harddiskmanager
-from Tools.Directories import *
+from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename
-from enigma import *
-
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
+from enigma import RT_HALIGN_LEFT, loadPNG, eListbox, eListboxPythonMultiContent, \
+ eServiceReference, eServiceCenter, gFont
EXTENSIONS = {
"mp3": "music",
directories.sort()
files.sort()
else:
- files = os.listdir(directory)
+ files = listdir(directory)
files.sort()
tmpfiles = files[:]
for x in tmpfiles:
- if os.path.isdir(directory + x):
+ if os_path.isdir(directory + x):
directories.append(directory + x + "/")
files.remove(x)
-import os
+from os import system
-from Tools.Directories import *
+from Tools.Directories import SCOPE_HDD, resolveFilename
def tryOpen(filename):
try:
def unmount(self):
cmd = "/bin/umount " + self.devidex + "part*"
- res = os.system(cmd)
+ res = system(cmd)
return (res >> 8)
def createPartition(self):
def mkfs(self):
cmd = "/sbin/mkfs.ext3 -T largefile -m0 " + self.devidex + "part1"
- res = os.system(cmd)
+ res = system(cmd)
return (res >> 8)
def mount(self):
cmd = "/bin/mount -t ext3 " + self.devidex + "part1 /hdd"
- res = os.system(cmd)
+ res = system(cmd)
return (res >> 8)
def createMovieFolder(self):
- res = os.system("mkdir " + resolveFilename(SCOPE_HDD))
+ res = system("mkdir " + resolveFilename(SCOPE_HDD))
return (res >> 8)
errorList = [ _("Everything is fine"), _("Creating partition failed"), _("Mkfs failed"), _("Mount failed"), _("Create movie folder failed"), _("Unmount failed")]
import gettext
-import os
-from Tools.Directories import *
+from Tools.Directories import SCOPE_LANGUAGE, resolveFilename
class Language:
def __init__(self):
-from HTMLComponent import *
-from GUIComponent import *
-
-from MenuList import MenuList
-
-from Tools.Directories import *
-
-from enigma import *
-
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
-
-def LanguageEntryComponent(file, name, index):
- res = [ index ]
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 80, 10, 200, 50, 0, RT_HALIGN_LEFT ,name))
- png = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "countries/" + file + ".png"))
- if png == None:
- png = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "countries/missing.png"))
- res.append((eListboxPythonMultiContent.TYPE_PIXMAP, 10, 5, 60, 40, png))
-
- return res
-
-class LanguageList(MenuList, HTMLComponent, GUIComponent):
- def __init__(self, list):
- GUIComponent.__init__(self)
- self.l = eListboxPythonMultiContent()
- self.list = list
- self.l.setList(list)
- self.l.setFont(0, gFont("Regular", 20))
-
- GUI_WIDGET = eListbox
-
- def postWidgetCreate(self, instance):
- instance.setContent(self.l)
- instance.setItemHeight(50)
from MenuList import MenuList
-from Tools.Directories import *
-import os
+from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename
+from os import path
-from enigma import *
-
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
+from enigma import eListboxPythonMultiContent, eListbox, RT_VALIGN_CENTER, loadPNG, gFont
STATE_PLAY = 0
STATE_PAUSE = 1
def PlaylistEntryComponent(serviceref, state):
res = [ serviceref ]
- res.append((eListboxPythonMultiContent.TYPE_TEXT,25, 0, 470, 32, 0, RT_VALIGN_CENTER, os.path.split(serviceref.getPath().split('/')[-1])[1]))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT,25, 0, 470, 32, 0, RT_VALIGN_CENTER, path.split(serviceref.getPath().split('/')[-1])[1]))
png = None
if state == STATE_PLAY:
png = PlayIcon
from GUIComponent import *
from Tools.FuzzyDate import FuzzyTime
from ServiceReference import ServiceReference
-from Components.MultiContent import MultiContentEntryText, RT_HALIGN_LEFT, RT_HALIGN_RIGHT
+from Components.MultiContent import MultiContentEntryText
-from enigma import eListboxPythonMultiContent, eListbox, gFont, iServiceInformation
-
-from enigma import eServiceReference, eServiceCenter, \
- eServiceCenterPtr, iListableServicePtr, \
- iStaticServiceInformationPtr
+from enigma import eListboxPythonMultiContent, eListbox, gFont, iServiceInformation, \
+ RT_HALIGN_LEFT, RT_HALIGN_RIGHT, eServiceReference, eServiceCenter
class MovieList(GUIComponent):
def __init__(self, root):
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
-
-RT_WRAP = 32
-
-from enigma import eListboxPythonMultiContent
+from enigma import eListboxPythonMultiContent, RT_HALIGN_LEFT, RT_VALIGN_TOP
def MultiContentEntryText(pos = (0, 0), size = (0, 0), font = 0, flags = RT_HALIGN_LEFT | RT_VALIGN_TOP, text = "", color = None):
add = ()
print "[Network.py] parsing network failed"
def deactivateNetworkConfig(self):
- import os
os.system("ip addr flush eth0")
os.system("/etc/init.d/networking stop")
os.system("killall -9 udhcpc")
os.system("rm /var/run/udhcpc*")
def activateNetworkConfig(self):
- import os
os.system("/etc/init.d/networking start")
config.network.ip.value = self.getCurrentIP()
config.network.ip.save()
from MenuList import MenuList
from Components.ParentalControl import parentalControl
-from Tools.Directories import *
+from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename
-from enigma import *
-
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
+from enigma import loadPNG, eListbox, eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT
lockPicture = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "lock-fs8.png"))
-import os
-import traceback
-import sys
+from os import path as os_path, listdir as os_listdir
+from traceback import print_exc
+from sys import stdout
-from Tools.Directories import *
+from Tools.Directories import fileExists
from Tools.Import import my_import
from Plugins.Plugin import PluginDescriptor
def readPluginList(self, directory):
"""enumerates plugins"""
- categories = os.listdir(directory)
+ categories = os_listdir(directory)
new_plugins = [ ]
for c in categories:
directory_category = directory + c
- if not os.path.isdir(directory_category):
+ if not os_path.isdir(directory_category):
continue
open(directory_category + "/__init__.py", "a").close()
- for pluginname in os.listdir(directory_category):
+ for pluginname in os_listdir(directory_category):
path = directory_category + "/" + pluginname
- if os.path.isdir(path):
+ if os_path.isdir(path):
if fileExists(path + "/plugin.pyc") or fileExists(path + "/plugin.py"):
try:
plugin = my_import('.'.join(["Plugins", c, pluginname, "plugin"]))
plugins = plugin.Plugins(path=path)
except Exception, exc:
print "Plugin ", c + "/" + pluginname, "failed to load:", exc
- traceback.print_exc(file=sys.stdout)
+ print_exc(file=stdout)
print "skipping plugin."
self.warnings.append( (c + "/" + pluginname, str(exc)) )
continue
from MenuList import MenuList
from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE
-from Components.MultiContent import RT_HALIGN_LEFT, MultiContentEntryText, MultiContentEntryPixmapAlphaTest
+from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest
-from enigma import *
+from enigma import loadPNG, eListboxPythonMultiContent, RT_HALIGN_LEFT, eListbox, gFont
def PluginEntryComponent(plugin):
res = [ plugin ]
-from config import *
-from enigma import *
+from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigSlider
+from enigma import eRFmod
# CHECK ME.
RFMOD_CHANNEL_MIN = 21
def InitRFmod():
- config.rfmod = ConfigSubsection();
+ config.rfmod = ConfigSubsection()
config.rfmod.enable = ConfigOnOff(default=False)
config.rfmod.test = ConfigOnOff(default=False)
config.rfmod.sound = ConfigOnOff(default=True)
from HTMLComponent import *
from GUIComponent import *
-from enigma import *
+from enigma import loadPNG, eListboxServiceContent, eListbox, eServiceCenter, eServiceReference, gFont, eRect
from string import upper
from PerServiceDisplay import PerServiceDisplay, PerServiceBase
from Components.GUIComponent import GUIComponent
-from enigma import eTimer, iPlayableService, iSeekableServicePtr, ePositionGauge
+from enigma import eTimer, iPlayableService, ePositionGauge
import time
class ServicePosition(PerServiceDisplay, object):
from Tools.FuzzyDate import FuzzyTime
import time
-from enigma import eListboxPythonMultiContent, eListbox, gFont, loadPNG
+from enigma import eListboxPythonMultiContent, eListbox, gFont, loadPNG, \
+ RT_HALIGN_CENTER, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_VALIGN_CENTER
from timer import TimerEntry
from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
-
-RT_WRAP = 32
-
-
#
# | <Service> <Name of the Timer> |
# | <start, end> <state> |
import os
import time
-from enigma import *
-
class Timezones:
class parseTimezones(ContentHandler):
def __init__(self, timezones):
try:
time.tzset()
except:
- etimezone()
+ from enigma import e_tzset
+ e_tzset()
def getTimezoneList(self):
list = []
-from enigma import *
import time
import sys
python.cpp enigma_python_wrap.cxx connections.cpp
enigma_python_wrap.cxx: enigma_python.i
- swig -I$(top_srcdir)/ -c++ -python enigma_python.i
+ swig -I$(top_srcdir)/ -c++ -python -O -nortti -nothreads enigma_python.i
+ python enigma_py_patcher.py
installdir = $(LIBDIR)/enigma2/python
-from enigma import *
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
from Components.Label import Label
from Components.Input import Input
-from Components.GUIComponent import *
from Components.Pixmap import Pixmap
from Components.FileList import FileEntryComponent, FileList
from Screens.ChoiceBox import ChoiceBox
from Plugins.Plugin import PluginDescriptor
-import os
-
class Test(Screen):
skin = """
<screen position="100,100" size="550,400" title="Test" >
from Components.ServicePosition import ServicePositionGauge
from Components.ActionMap import HelpableActionMap
from Components.MenuList import MenuList
-from Components.MultiContent import MultiContentEntryText, RT_HALIGN_RIGHT
+from Components.MultiContent import MultiContentEntryText
from Components.ServiceEventTracker import ServiceEventTracker
from Screens.InfoBarGenerics import InfoBarSeek, InfoBarCueSheetSupport
from Components.GUIComponent import GUIComponent
-from enigma import eListboxPythonMultiContent, eListbox, gFont, iPlayableService
+from enigma import eListboxPythonMultiContent, eListbox, gFont, iPlayableService, RT_HALIGN_RIGHT
from Screens.FixedMenu import FixedMenu
import bisect
-from enigma import *
from Screens.Screen import Screen
-from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
-from Components.Label import Label
-from Components.Input import Input
-from Components.GUIComponent import *
from Components.Pixmap import Pixmap
from Components.FileList import FileEntryComponent, FileList
from Plugins.Plugin import PluginDescriptor
-import os
-
class FileManager(Screen):
skin = """
<screen position="100,100" size="550,400" title="Test" >
self["text"].right()
def ok(self):
-
+
if self["list"].canDescent(): # isDir
self["list"].descent()
else:
from Plugins.Plugin import PluginDescriptor
-import os
-import string
+from os import path as os_path, walk as os_walk
+from string import lower
def getExtension(file):
p = file.rfind('.')
else:
ext = file[p+1:]
- return string.lower(ext)
+ return lower(ext)
class Scanner:
def __init__(self, name, extensions = [], paths_to_scan = [], description = "", openfnc = None):
# now scan the paths
for p in paths_to_scan:
- path = os.path.join(mountpoint, p.path)
+ path = os_path.join(mountpoint, p.path)
- for root, dirs, files in os.walk(path):
+ for root, dirs, files in os_walk(path):
for f in files:
ext = getExtension(f)
- pathname = os.path.join(root, f)
+ pathname = os_path.join(root, f)
for s in scanner:
s.handleFile(res, pathname, ext)
-from enigma import *
-
+from enigma import eTimer, loadPic, getExif
from Screens.Screen import Screen
from Screens.ServiceInfo import ServiceInfoList, ServiceInfoListEntry
from Components.ActionMap import ActionMap, NumberActionMap
from Plugins.Plugin import PluginDescriptor
-
config.pic = ConfigSubsection()
config.pic.slidetime = ConfigInteger(default=10, limits=(5, 60))
config.pic.resize = ConfigSelection(default="0", choices = [("0", _("simple")), ("1", _("better"))])
from Components.ActionMap import ActionMap
from Components.GUIComponent import GUIComponent
from Components.Label import Label
-from Components.MultiContent import MultiContentEntryText, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_WRAP
+from Components.MultiContent import MultiContentEntryText
from Plugins.Plugin import PluginDescriptor
-from enigma import eListboxPythonMultiContent, eListbox, gFont, iServiceInformation
+from enigma import eListboxPythonMultiContent, eListbox, gFont, iServiceInformation, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_WRAP
from twisted.web import server
from twisted.web.resource import Resource
# must be fixed for the new plugin interface
-from enigma import *
-from Screens.Screen import Screen
-from Screens.MessageBox import MessageBox
-from Components.ActionMap import ActionMap
-from Components.Label import Label
from Tools.BoundFunction import boundFunction
from Tools.Directories import pathExists
from Plugins.Plugin import PluginDescriptor
-import os
+from os import listdir
TUXBOX_PLUGINS_PATH = "/usr/lib/tuxbox/plugins/"
pluginlist = []
if pathExists(TUXBOX_PLUGINS_PATH):
- dir = os.listdir(TUXBOX_PLUGINS_PATH)
+ dir = listdir(TUXBOX_PLUGINS_PATH)
for x in dir:
if x[-3:] == "cfg":
-from enigma import *
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.Console import Console
from Components.ActionMap import ActionMap, NumberActionMap
-from Components.Pixmap import *
from Components.Pixmap import Pixmap
from Components.Label import Label
from Components.MenuList import MenuList
from Tools.NumericalTextInput import *
from Tools.Directories import *
-import os
-import string
-import time
-import datetime
+from os import path, makedirs, listdir
+from time import localtime
+from datetime import date
plugin_path = ""
def createBackupfolders(self):
self.path = BackupPath[self.backup.location.value]
print "Creating Backup Folder if not already there..."
- if (os.path.exists(self.path) == False):
- os.makedirs(self.path)
+ if (path.exists(self.path) == False):
+ makedirs(self.path)
def Backup(self):
print "this will start the backup now!"
def runBackup(self, result):
if result:
- if os.path.ismount(MountPoints[self.backup.location.value]):
+ if path.ismount(MountPoints[self.backup.location.value]):
self.createBackupfolders()
- d = time.localtime()
- dt = datetime.date(d.tm_year, d.tm_mon, d.tm_mday)
+ d = localtime()
+ dt = date(d.tm_year, d.tm_mon, d.tm_mday)
self.path = BackupPath[self.backup.location.value]
if self.backup.type.value == "full":
print "Backup Mode: Full"
def fill_list(self):
self.flist = []
self.path = BackupPath[self.backup.location.value]
- if (os.path.exists(self.path) == False):
- os.makedirs(self.path)
- for file in os.listdir(self.path):
+ if (path.exists(self.path) == False):
+ makedirs(self.path)
+ for file in listdir(self.path):
if (file.endswith(".tar.gz")):
self.flist.append((file))
self.entry = True
-from enigma import *
+from enigma import RT_HALIGN_LEFT, RT_VALIGN_CENTER, eListboxPythonMultiContent, eListbox, eTimer, gFont
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import ActionMap, NumberActionMap
from Screens.Console import Console
from Plugins.Plugin import PluginDescriptor
-import os
+from os import popen
class Upgrade(Screen):
skin = """
self.close()
def doUpdateDelay(self):
- lines = os.popen("ipkg update && ipkg upgrade -force-defaults -force-overwrite", "r").readlines()
+ lines = popen("ipkg update && ipkg upgrade -force-defaults -force-overwrite", "r").readlines()
string = ""
for x in lines:
string += x
else:
self.close()
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
-
def PacketEntryComponent(packet):
res = [ packet ]
def fillPacketList(self):
- lines = os.popen("ipkg list", "r").readlines()
+ lines = popen("ipkg list", "r").readlines()
packetlist = []
for x in lines:
split = x.split(' - ')
packetlist.append([split[0].strip(), split[1].strip()])
- lines = os.popen("ipkg list_installed", "r").readlines()
+ lines = popen("ipkg list_installed", "r").readlines()
installedlist = {}
for x in lines:
self.close()
def doUpdateDelay(self):
- lines = os.popen("ipkg update && ipkg upgrade", "r").readlines()
+ lines = popen("ipkg update && ipkg upgrade", "r").readlines()
string = ""
for x in lines:
string += x
-from enigma import eTimer, eDVBSatelliteEquipmentControl, eDVBResourceManager, eDVBDiseqcCommand, eDVBResourceManagerPtr, iDVBChannelPtr, iDVBFrontendPtr, iDVBFrontend, eDVBFrontendParametersSatellite, eDVBFrontendParameters
+from enigma import eTimer, eDVBSatelliteEquipmentControl, eDVBResourceManager, eDVBDiseqcCommand, eDVBFrontendParametersSatellite, eDVBFrontendParameters
from Screens.Screen import Screen
from Screens.ScanSetup import ScanSetup
from Screens.MessageBox import MessageBox
return self.frontend
def openFrontend(self):
- res_mgr = eDVBResourceManagerPtr()
- if eDVBResourceManager.getInstance(res_mgr) == 0:
- self.raw_channel = iDVBChannelPtr()
- if res_mgr.allocateRawChannel(self.raw_channel, self.feid) == 0:
- self.frontend = iDVBFrontendPtr()
- if self.raw_channel.getFrontend(self.frontend) == 0:
+ res_mgr = eDVBResourceManager.getInstance()
+ if res_mgr:
+ self.raw_channel = res_mgr.allocateRawChannel(self.feid)
+ if self.raw_channel:
+ self.frontend = self.raw_channel.getFrontend(self.frontend)
+ if self.frontend:
return True
else:
print "getFrontend failed"
self.createSetup()
def createConfig(self, foo):
+ global tuning
if not tuning:
- global tuning
tuning = ConfigSubsection()
tuning.type = ConfigSelection(
default = "manual_transponder",
-from enigma import eTimer, eDVBSatelliteEquipmentControl, eDVBResourceManager, eDVBDiseqcCommand, eDVBResourceManagerPtr, iDVBChannelPtr, iDVBFrontendPtr, iDVBFrontend, eDVBFrontendParametersSatellite, eDVBFrontendParameters
+from enigma import eTimer, eDVBSatelliteEquipmentControl, eDVBResourceManager, eDVBDiseqcCommand, eDVBFrontendParametersSatellite, eDVBFrontendParameters
from Screens.Screen import Screen
from Screens.ScanSetup import ScanSetup
from Screens.MessageBox import MessageBox
</screen>"""
def openFrontend(self):
- res_mgr = eDVBResourceManagerPtr()
- if eDVBResourceManager.getInstance(res_mgr) == 0:
- self.raw_channel = iDVBChannelPtr()
- if res_mgr.allocateRawChannel(self.raw_channel, self.feid) == 0:
- self.frontend = iDVBFrontendPtr()
- if self.raw_channel.getFrontend(self.frontend) == 0:
+ res_mgr = eDVBResourceManager.getInstance()
+ if res_mgr:
+ self.raw_channel = res_mgr.allocateRawChannel(self.feid)
+ if self.raw_channel:
+ self.frontend = self.raw_channel.getFrontend()
+ if self.frontend:
return True
else:
print "getFrontend failed"
# -*- coding: iso-8859-1 -*-
# (c) 2006 Stephan Reichholf
# This Software is Free, use it where you want, when you want for whatever you want and modify it if you want but don't remove my copyright!
-
-from enigma import *
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
from Components.Pixmap import Pixmap
-from Components.GUIComponent import *
from Components.MenuList import MenuList
from Plugins.Plugin import PluginDescriptor
-
from Components.config import config
from Tools.Directories import SCOPE_SKIN
-
from Components.config import config
-import os, sys
+from os import path, walk
class SkinSelector(Screen):
# for i18n:
self.session = session
self.previewPath = ""
- os.path.walk(self.root, self.find, "")
+ path.walk(self.root, self.find, "")
self.skinlist.sort()
self["SkinList"] = MenuList(self.skinlist)
else:
pngpath = self.root+self["SkinList"].getCurrent()+"/prev.png"
- if not os.path.exists(pngpath):
+ if not path.exists(pngpath):
# FIXME: don't use hardcoded path
pngpath = "/usr/lib/enigma2/python/Plugins/SystemPlugins/SkinSelector/noprev.png"
-from enigma import eTimer, quitMainloop
+from enigma import eTimer, quitMainloop, RT_HALIGN_LEFT, RT_VALIGN_CENTER, eListboxPythonMultiContent, eListbox, gFont
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import ActionMap, NumberActionMap
from Components.Slider import Slider
from Components.Label import Label
-import os
+from os import popen
class UpdatePluginMenu(Screen):
skin = """
print "pressed", number
self["text"].number(number)
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
-
def PacketEntryComponent(packet):
res = [ packet ]
def fillPacketList(self):
- lines = os.popen("ipkg list", "r").readlines()
+ lines = popen("ipkg list", "r").readlines()
packetlist = []
for x in lines:
split = x.split(' - ')
packetlist.append([split[0].strip(), split[1].strip()])
- lines = os.popen("ipkg list_installed", "r").readlines()
+ lines = popen("ipkg list_installed", "r").readlines()
installedlist = {}
for x in lines:
self.close()
def doUpdateDelay(self):
- lines = os.popen("ipkg update && ipkg upgrade", "r").readlines()
+ lines = popen("ipkg update && ipkg upgrade", "r").readlines()
string = ""
for x in lines:
string += x
from Components.MenuList import MenuList
from Components.ServiceEventTracker import ServiceEventTracker
from EpgSelection import EPGSelection
-from enigma import eServiceReference, eEPGCache, eServiceCenter, eServiceCenterPtr, iMutableServiceListPtr, iStaticServiceInformationPtr, eTimer, eDVBDB, iPlayableService, iServiceInformation
+from enigma import eServiceReference, eEPGCache, eServiceCenter, eTimer, eDVBDB, iPlayableService, iServiceInformation
from Components.config import config, ConfigSubsection, ConfigText
from Screens.FixedMenu import FixedMenu
from Tools.NumericalTextInput import NumericalTextInput
-from enigma import *
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
from Components.Label import Label
from Components.MenuList import MenuList
-from Components.GUIComponent import *
from Components.ChoiceList import ChoiceEntryComponent, ChoiceList
-import os
-
class ChoiceBox(Screen):
def __init__(self, session, title = "", list = [], keys = None, selection = 0):
Screen.__init__(self, session)
from Components.Button import Button
from Components.Label import Label
-from Components.HTMLComponent import *
-from Components.GUIComponent import *
from Components.config import config, ConfigSubsection, ConfigSelection, ConfigSubList, getConfigListEntry, KEY_LEFT, KEY_RIGHT, KEY_0, ConfigNothing, ConfigPIN
from Components.ConfigList import ConfigList
from Components.Button import Button
from Components.config import config
-from enigma import *
+from enigma import eDVBSatelliteEquipmentControl
class Dish(Screen):
def __init__(self, session):
from Components.ScrollLabel import ScrollLabel
from Screens.EventView import EventViewSimple
from TimeDateInput import TimeDateInput
-from enigma import eServiceReference, eServiceEventPtr
+from enigma import eServiceReference
from Screens.FixedMenu import FixedMenu
from RecordTimer import RecordTimerEntry, parseEvent
from TimerEdit import TimerEditList
from Components.Button import Button
from Components.Label import Label
from Components.ScrollLabel import ScrollLabel
-from enigma import eServiceEventPtr, eEPGCache, eTimer, eServiceReference
+from enigma import eEPGCache, eTimer, eServiceReference
from ServiceReference import ServiceReference
from RecordTimer import RecordTimerEntry, parseEvent
from TimerEntry import TimerEntry
from Screens.ChannelSelection import ChannelSelectionRadio
from Screens.MessageBox import MessageBox
from Screens.Ci import CiHandler
-from ServiceReference import ServiceReference
from Components.Sources.Clock import Clock
-from Components.ActionMap import ActionMap, HelpableActionMap
+from Components.ActionMap import HelpableActionMap
from Components.config import config
from Tools.Notifications import AddNotificationWithCallback
from Screens.HelpMenu import HelpableScreen, HelpMenu
-from enigma import *
-
-import time
-
class InfoBar(InfoBarShowHide,
InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRadioText,
InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection,
from ServiceReference import ServiceReference
from Tools import Notifications
-from Tools.Directories import *
+from Tools.Directories import SCOPE_HDD, resolveFilename
-#from enigma import eTimer, eDVBVolumecontrol, quitMainloop
-from enigma import *
+from enigma import eTimer, eServiceCenter, eDVBServicePMTHandler, iServiceInformation, \
+ iPlayableService, eServiceReference, eDVBResourceManager, iFrontendInformation
-import time
-import os
-import bisect
+from time import time
+from os import stat as os_stat
+from bisect import insort
# hack alert!
from Menu import MainMenu, mdom
print "hu, timeshift already enabled?"
else:
if not ts.startTimeshift():
- import time
self.timeshift_enabled = 1
# we remove the "relative time" for now.
except:
pass
- begin = time.time()
- end = time.time() + 3600 * 10
+ begin = time()
+ end = time() + 3600 * 10
name = "instant record"
description = ""
eventid = None
def instantRecord(self):
try:
- stat = os.stat(resolveFilename(SCOPE_HDD))
+ stat = os_stat(resolveFilename(SCOPE_HDD))
except:
self.session.open(MessageBox, _("No HDD found or HDD not initialized!"), MessageBox.TYPE_ERROR)
return
self["ExtensionsAvailable"] = Boolean(fixed=1)
self.session.nav.event.append(self.gotServiceEvent) # we like to get service events
- res_mgr = eDVBResourceManagerPtr()
- if eDVBResourceManager.getInstance(res_mgr) == 0:
+ res_mgr = eDVBResourceManager.getInstance()
+ if res_mgr:
res_mgr.frontendUseMaskChanged.get().append(self.tunerUseMaskChanged)
def tunerUseMaskChanged(self, mask):
return None
def addMark(self, point):
- bisect.insort(self.cut_list, point)
+ insort(self.cut_list, point)
self.uploadCuesheet()
def removeMark(self, point):
-from enigma import *
+from enigma import eRCInput, getPrevAsciiCode
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
from Components.Label import Label
from Components.Input import Input
-from Components.GUIComponent import *
from Tools.BoundFunction import boundFunction
from time import time
-import os
-
class InputBox(Screen):
def __init__(self, session, title = "", windowTitle = _("Input"), **kwargs):
Screen.__init__(self, session)
self.triesEntry.tries.save()
def showTries(self):
- self["tries"].setText(_("Tries left:") + " " + str(self.getTries()))
\ No newline at end of file
+ self["tries"].setText(_("Tries left:") + " " + str(self.getTries()))
from Components.ActionMap import NumberActionMap
from Components.Label import Label
from Components.Input import Input
-from Components.GUIComponent import *
from Components.Pixmap import Pixmap
from Components.Label import Label
from Components.FileList import FileEntryComponent, FileList
from Components.Label import Label
from Components.Sources.CurrentService import CurrentService
-from enigma import *
-
class PVRState(Screen):
def __init__(self, session):
Screen.__init__(self, session)
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox, Input, PinInput
from Screens.ChannelSelection import service_types_tv
-from Tools.Directories import resolveFilename, SCOPE_CONFIG
from Tools.BoundFunction import boundFunction
from ServiceReference import ServiceReference
from enigma import eServiceCenter, eServiceReference, eTimer
-import os
-import operator
+from operator import itemgetter
class ProtectedScreen:
def __init__(self):
else:
x = (x, x)
mylist.append(x)
- mylist.sort(key=operator.itemgetter(1))
+ mylist.sort(key=itemgetter(1))
sel = ord(self.currentLetter) - SPECIAL_CHAR
self.session.openWithCallback(self.letterChosen, ChoiceBox, title=_("Show services beginning with"), list=mylist, keys = [], selection = sel)
-from enigma import *
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
from Components.Label import Label
from Components.MenuList import MenuList
-from Components.GUIComponent import *
from Components.ChoiceList import ChoiceEntryComponent, ChoiceList
-import os
-
# this is not so great.
MAX_X = 720
MAX_Y = 576
from Screen import Screen
from MessageBox import MessageBox
-
from Components.AVSwitch import AVSwitch
-from enigma import *
-
class Scart(Screen):
def __init__(self, session, start_visible=True):
Screen.__init__(self, session)
from Components.ActionMap import ActionMap
from Components.config import config
from Components.AVSwitch import AVSwitch
-from enigma import *
+from enigma import eDVBVolumecontrol, eDBoxLCD
class Standby(Screen):
def Power(self):
--- /dev/null
+#read the comment to this file in lib/service/iservice.h !!
+
+import os
+
+os.rename("enigma.py", "enigma.py.org")
+
+source=open("enigma.py.org", "r")
+dest=open("enigma.py", "w")
+
+line=1
+for str in source.readlines():
+ oldstr = str[:]
+ str = str.replace('_ENUMS)', ')')
+ str = str.replace('_REPLACE)', ')')
+
+ pos = str.find('_ENUMS')
+ if pos != -1:
+ spacepos = pos
+ while spacepos > 0 and str[spacepos] != ' ':
+ spacepos -= 1
+ tmpstr = str[spacepos:pos]
+ if tmpstr.find('_enigma.') == -1:
+ str = str[:pos]+str[pos+6:]
+
+ pos = str.find('_REPLACE')
+ if pos != -1:
+ spacepos = pos
+ while spacepos > 0 and str[spacepos] != ' ':
+ spacepos -= 1
+ tmpstr = str[spacepos:pos]
+ if tmpstr.find('_enigma.') == -1:
+ str = str[:pos]+str[pos+8:]
+
+
+ if oldstr != str:
+ print "!!! Patch enigma.py line %d\n%s\n%s" %(line, oldstr[:len(oldstr)-1], str)
+
+ dest.write(str)
+ line += 1
+
+del source
+del dest
+os.remove("enigma.py.org")
#include <lib/gdi/lcd.h>
#include <lib/dvb_ci/dvbci_ui.h>
#include <lib/python/python.h>
-#include <lib/gdi/picexif.h>
#include <lib/gdi/picload.h>
extern void runMainloop();
%include <lib/base/smartptr.h>
%include <lib/service/iservice.h>
%include <lib/service/service.h>
-
-%template(eServiceCenterPtr) ePtr<eServiceCenter>;
%include <lib/service/event.h>
// TODO: embed these...
%include <lib/dvb_ci/dvbci_ui.h>
%include <lib/dvb/db.h>
%include <lib/python/python.h>
-%include <lib/gdi/picexif.h>
%include <lib/gdi/picload.h>
/************** eptr **************/
-%template(eActionMapPtr) ePtr<eActionMap>;
-
/************** signals **************/
template<class R> class PSignal0
TestObj();
~TestObj();
};
-TEMPLATE_TYPEDEF(ePtr<TestObj>, TestObjPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<TestObj>, TestObjPtr);
#ifndef SWIG
extern PyObject *New_TestObj();
#define __lib_python_swig_h
#ifdef SWIG
-#define TEMPLATE_TYPEDEF(x, y) \
-%template(y) x; \
-typedef x y; \
-%typemap_output_ptr(x);
-#define SWIG_ALLOW_OUTPUT_SIMPLE(x) %typemap_output_simple(x);
-#else
-#define TEMPLATE_TYPEDEF(x, y) typedef x y
-#define SWIG_ALLOW_OUTPUT_SIMPLE(x)
-#endif
-
-
-#ifdef SWIG
+#define SWIG_IGNORE(x) %ignore x
+#define SWIG_EXTEND(x, code) %extend x { code }
+#define SWIG_TEMPLATE_TYPEDEF(x, y) %template(y) x; %typemap_output_ptr(x)
+#define SWIG_TEMPLATE_TYPEDEF_REPLACE(x, y) %template(y##_REPLACE) x; %typemap_output_ptr(x)
+#define SWIG_ALLOW_OUTPUT_SIMPLE(x) %typemap_output_simple(x)
#define SWIG_INPUT INPUT
#define SWIG_OUTPUT OUTPUT
#define SWIG_NAMED_OUTPUT(x) OUTPUT
#define SWIG_VOID(x) void
#define SWIG_PYOBJECT(x) PyObject*
#else
+#define SWIG_IGNORE(x)
+#define SWIG_EXTEND(x, code)
+#define SWIG_TEMPLATE_TYPEDEF(x, y)
+#define SWIG_TEMPLATE_TYPEDEF_REPLACE(x, y)
+#define SWIG_ALLOW_OUTPUT_SIMPLE(x)
#define SWIG_INPUT
#define SWIG_OUTPUT
#define SWIG_NAMED_OUTPUT(x) x
#define SWIG_VOID(x) x
#define SWIG_PYOBJECT(x) x
-#endif
+#endif // SWIG
-#endif
+#endif // __lib_python_swig_h
#ifndef SWIG
#include <time.h>
-#include <lib/base/object.h>
-#include <lib/service/iservice.h>
#include <list>
#include <string>
class Event;
#endif
+#include <lib/base/object.h>
+#include <lib/service/iservice.h>
+
+SWIG_IGNORE(eComponentData);
struct eComponentData
{
DECLARE_REF(eComponentData);
std::string getIso639LanguageCode(void) const { return m_iso639LanguageCode; }
std::string getText(void) const { return m_text; }
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<eComponentData>, eComponentDataPtr);
-TEMPLATE_TYPEDEF(ePtr<eComponentData>, eComponentDataPtr);
-
+SWIG_IGNORE(eServiceEvent);
class eServiceEvent: public iObject
{
DECLARE_REF(eServiceEvent);
int getNumOfLinkageServices() const { return m_linkage_services.size(); }
SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, eServiceReference &parent, int num) const;
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
-TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
#ifndef SWIG
-
+SWIG_IGNORE(eDebugClass);
class eDebugClass: public iObject
{
DECLARE_REF(eDebugClass);
eDebugClass(int i) { printf("build debug class %d\n", i); x = i; }
~eDebugClass() { printf("remove debug class %d\n", x); }
};
-
-// TEMPLATE_TYPEDEF(ePtr<eDebugClass>, eDebugClassPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<eDebugClass>, eDebugClassPtr);
#endif
#endif
Hide the result only if there is another way to check for failure! */
-TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
-
+SWIG_TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
+
+SWIG_IGNORE(iStaticServiceInformation);
class iStaticServiceInformation: public iObject
{
#ifdef SWIG
#endif
public:
virtual SWIG_VOID(RESULT) getName(const eServiceReference &ref, std::string &SWIG_OUTPUT)=0;
-
+
// doesn't need to be implemented, should return -1 then.
virtual int getLength(const eServiceReference &ref);
virtual SWIG_VOID(RESULT) getEvent(const eServiceReference &ref, ePtr<eServiceEvent> &SWIG_OUTPUT, time_t start_time=-1);
virtual int getInfo(const eServiceReference &ref, int w);
virtual std::string getInfoString(const eServiceReference &ref,int w);
virtual PyObject *getInfoObject(const eServiceReference &ref, int w);
-
+
virtual int setInfo(const eServiceReference &ref, int w, int v);
virtual int setInfoString(const eServiceReference &ref, int w, const char *v);
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iStaticServiceInformation>, iStaticServiceInformationPtr);
-TEMPLATE_TYPEDEF(ePtr<iStaticServiceInformation>, iStaticServiceInformationPtr);
-
-class iServiceInformation: public iObject
+class iServiceInformation_ENUMS
{
#ifdef SWIG
- iServiceInformation();
- ~iServiceInformation();
+ iServiceInformation_ENUMS();
+ ~iServiceInformation_ENUMS();
#endif
public:
- virtual SWIG_VOID(RESULT) getName(std::string &SWIG_OUTPUT)=0;
- virtual SWIG_VOID(RESULT) getEvent(ePtr<eServiceEvent> &SWIG_OUTPUT, int nownext);
-
enum {
- sIsCrypted, /* is encrypted (no indication if decrypt was possible) */
- sAspect, /* aspect ratio: 0=4:3, 1=16:9, 2=whatever we need */
- sIsMultichannel, /* multichannel *available* (probably not selected) */
-
+ sIsCrypted, /* is encrypted (no indication if decrypt was possible) */
+ sAspect, /* aspect ratio: 0=4:3, 1=16:9, 2=whatever we need */
+ sIsMultichannel, /* multichannel *available* (probably not selected) */
+
/* "user serviceable info" - they are not reliable. Don't use them for anything except the service menu!
- that's also the reason why they are so globally defined.
-
-
+ that's also the reason why they are so globally defined.
again - if somebody EVER tries to use this information for anything else than simply displaying it,
i will change this to return a user-readable text like "zero x zero three three" (and change the
- exact spelling in every version) to stop that!
- */
+ exact spelling in every version) to stop that! */
+
sVideoPID,
sAudioPID,
sPCRPID,
sPMTPID,
sTXTPID,
-
+
sSID,
sONID,
sTSID,
sNamespace,
sProvider,
-
+
sDescription,
sServiceref,
- sTimeCreate, // unix time or string
-
+ sTimeCreate, /* unix time or string */
+
sTitle,
sArtist,
sAlbum,
sTracknumber,
sGenre,
sCAIDs,
- sVideoType, // MPEG2 MPEG4
-
- sTags, /* space seperated list of tags */
-
- sDVBState, /* states as defined in pmt handler (as events there) */
+ sVideoType, /* MPEG2 MPEG4 */
+
+ sTags, /* space seperated list of tags */
+
+ sDVBState, /* states as defined in pmt handler (as events there) */
sVideoHeight,
sVideoWidth,
-
- sTransponderData /* transponderdata as python dict */
+
+ sTransponderData /* transponderdata as python dict */
+ };
+ enum {
+ resNA = -1,
+ resIsString = -2,
+ resIsPyObject = -3
};
- enum { resNA = -1, resIsString = -2, resIsPyObject = -3 };
+};
+
+/* some words to structs like struct iServiceInformation_ENUMS
+For some classes we need in python just the SmartPointer Variants.
+So we prevent building wrapper classes for the non smart pointer classes with the SWIG_IGNORE makro.
+But now we have the problem that swig do not export enums for smart pointer classes (i dont know why).
+So we move all enum's to own classes (with _ENUMS as name ending) and let our real
+class inherit from the *_ENUMS class. This *_ENUMS classes are normally exportet via swig to python.
+But in the python code we doesn't like to write iServiceInformation_ENUMS.sVideoType....
+we like to write iServiceInformation.sVideoType.
+So until swig have no Solution for this Problem we call in lib/python/Makefile.am a python script named
+enigma_py_patcher.py to remove the "_ENUMS" strings in enigma.py at all needed locations. */
+
+SWIG_IGNORE(iServiceInformation);
+class iServiceInformation: public iServiceInformation_ENUMS, public iObject
+{
+#ifdef SWIG
+ iServiceInformation();
+ ~iServiceInformation();
+#endif
+public:
+ virtual SWIG_VOID(RESULT) getName(std::string &SWIG_OUTPUT)=0;
+ virtual SWIG_VOID(RESULT) getEvent(ePtr<eServiceEvent> &SWIG_OUTPUT, int nownext);
virtual int getInfo(int w);
virtual std::string getInfoString(int w);
virtual PyObject *getInfoObject(int w);
-
+
virtual int setInfo(int w, int v);
virtual int setInfoString(int w, const char *v);
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iServiceInformation>, iServiceInformationPtr);
-TEMPLATE_TYPEDEF(ePtr<iServiceInformation>, iServiceInformationPtr);
-
-class iFrontendInformation: public iObject
+class iFrontendInformation_ENUMS
{
#ifdef SWIG
- iFrontendInformation();
- ~iFrontendInformation();
+ iFrontendInformation_ENUMS();
+ ~iFrontendInformation_ENUMS();
#endif
public:
enum {
syncState,
frontendNumber
};
+};
+
+SWIG_IGNORE(iFrontendInformation);
+class iFrontendInformation: public iFrontendInformation_ENUMS, public iObject
+{
+#ifdef SWIG
+ iFrontendInformation();
+ ~iFrontendInformation();
+#endif
+public:
virtual int getFrontendInfo(int w)=0;
virtual PyObject *getFrontendData(bool original=false)=0;
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iFrontendInformation>, iFrontendInformationPtr);
-TEMPLATE_TYPEDEF(ePtr<iFrontendInformation>, iFrontendInformationPtr);
-
+SWIG_IGNORE(iPauseableService);
class iPauseableService: public iObject
{
#ifdef SWIG
public:
virtual RESULT pause()=0;
virtual RESULT unpause()=0;
-
+
/* hm. */
virtual RESULT setSlowMotion(int ratio=0)=0;
virtual RESULT setFastForward(int ratio=0)=0;
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iPauseableService>, iPauseableServicePtr);
-TEMPLATE_TYPEDEF(ePtr<iPauseableService>, iPauseableServicePtr);
+class iSeekableService_ENUMS
+{
+#ifdef SWIG
+ iSeekableService_ENUMS();
+ ~iSeekableService_ENUMS();
+#endif
+public:
+ enum { dirForward = +1, dirBackward = -1 };
+};
-class iSeekableService: public iObject
+SWIG_IGNORE(iSeekableService);
+class iSeekableService: public iSeekableService_ENUMS, public iObject
{
#ifdef SWIG
iSeekableService();
public:
virtual RESULT getLength(pts_t &SWIG_OUTPUT)=0;
virtual RESULT seekTo(pts_t to)=0;
- enum { dirForward = +1, dirBackward = -1 };
virtual RESULT seekRelative(int direction, pts_t to)=0;
virtual RESULT getPlayPosition(pts_t &SWIG_OUTPUT)=0;
- /* if you want to do several seeks in a row, you can enable the trickmode.
+ /* if you want to do several seeks in a row, you can enable the trickmode.
audio will be switched off, sync will be disabled etc. */
virtual RESULT setTrickmode(int trick=0)=0;
virtual RESULT isCurrentlySeekable()=0;
};
-
-TEMPLATE_TYPEDEF(ePtr<iSeekableService>, iSeekableServicePtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<iSeekableService>, iSeekableServicePtr);
struct iAudioTrackInfo
{
std::string getDescription() { return m_description; }
std::string getLanguage() { return m_language; }
};
-
SWIG_ALLOW_OUTPUT_SIMPLE(iAudioTrackInfo);
+SWIG_IGNORE(iAudioTrackSelection);
class iAudioTrackSelection: public iObject
{
#ifdef SWIG
virtual RESULT selectTrack(unsigned int i)=0;
virtual SWIG_VOID(RESULT) getTrackInfo(struct iAudioTrackInfo &SWIG_OUTPUT, unsigned int n)=0;
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iAudioTrackSelection>, iAudioTrackSelectionPtr);
-TEMPLATE_TYPEDEF(ePtr<iAudioTrackSelection>, iAudioTrackSelectionPtr);
+class iAudioChannelSelection_ENUMS
+{
+#ifdef SWIG
+ iAudioChannelSelection_ENUMS();
+ ~iAudioChannelSelection_ENUMS();
+#endif
+public:
+ enum { LEFT, STEREO, RIGHT };
+};
-class iAudioChannelSelection: public iObject
+SWIG_IGNORE(iAudioChannelSelection);
+class iAudioChannelSelection: public iAudioChannelSelection_ENUMS, public iObject
{
#ifdef SWIG
iAudioChannelSelection();
~iAudioChannelSelection();
#endif
public:
- enum { LEFT, STEREO, RIGHT };
virtual int getCurrentChannel()=0;
virtual RESULT selectChannel(int i)=0;
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iAudioChannelSelection>, iAudioChannelSelectionPtr);
-TEMPLATE_TYPEDEF(ePtr<iAudioChannelSelection>, iAudioChannelSelectionPtr);
-
+SWIG_IGNORE(iAudioDelay);
class iAudioDelay: public iObject
{
#ifdef SWIG
virtual void setAC3Delay(int)=0;
virtual void setPCMDelay(int)=0;
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iAudioDelay>, iAudioDelayPtr);
-TEMPLATE_TYPEDEF(ePtr<iAudioDelay>, iAudioDelayPtr);
-
+SWIG_IGNORE(iRadioText);
class iRadioText: public iObject
{
#ifdef SWIG
public:
virtual std::string getRadioText(int x=0)=0;
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iRadioText>, iRadioTextPtr);
-TEMPLATE_TYPEDEF(ePtr<iRadioText>, iRadioTextPtr);
-
+SWIG_IGNORE(iSubserviceList);
class iSubserviceList: public iObject
{
#ifdef SWIG
virtual int getNumberOfSubservices()=0;
virtual SWIG_VOID(RESULT) getSubservice(eServiceReference &SWIG_OUTPUT, unsigned int n)=0;
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iSubserviceList>, iSubserviceListPtr);
-TEMPLATE_TYPEDEF(ePtr<iSubserviceList>, iSubserviceListPtr);
-
+SWIG_IGNORE(iTimeshiftService);
class iTimeshiftService: public iObject
{
#ifdef SWIG
public:
virtual RESULT startTimeshift()=0;
virtual RESULT stopTimeshift()=0;
-
+
virtual int isTimeshiftActive()=0;
/* this essentially seeks to the relative end of the timeshift buffer */
virtual RESULT activateTimeshift()=0;
};
-
-TEMPLATE_TYPEDEF(ePtr<iTimeshiftService>, iTimeshiftServicePtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<iTimeshiftService>, iTimeshiftServicePtr);
/* not related to eCueSheet */
-class iCueSheet: public iObject
+
+class iCueSheet_ENUMS
+{
+#ifdef SWIG
+ iCueSheet_ENUMS();
+ ~iCueSheet_ENUMS();
+#endif
+public:
+ enum { cutIn = 0, cutOut = 1, cutMark = 2 };
+};
+
+SWIG_IGNORE(iCueSheet);
+class iCueSheet: public iCueSheet_ENUMS, public iObject
{
#ifdef SWIG
iCueSheet();
~iCueSheet();
#endif
public:
- /* returns a list of (pts, what)-tuples */
+ /* returns a list of (pts, what)-tuples */
virtual PyObject *getCutList() = 0;
virtual void setCutList(SWIG_PYOBJECT(ePyObject) list) = 0;
virtual void setCutListEnable(int enable) = 0;
- enum { cutIn = 0, cutOut = 1, cutMark = 2 };
};
-
-TEMPLATE_TYPEDEF(ePtr<iCueSheet>, iCueSheetPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<iCueSheet>, iCueSheetPtr);
class eWidget;
class PyList;
+SWIG_IGNORE(iSubtitleOutput);
class iSubtitleOutput: public iObject
{
public:
virtual PyObject *getSubtitleList()=0;
virtual PyObject *getCachedSubtitle()=0;
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iSubtitleOutput>, iSubtitleOutputPtr);
-TEMPLATE_TYPEDEF(ePtr<iSubtitleOutput>, iSubtitleOutputPtr);
+SWIG_IGNORE(iMutableServiceList);
+class iMutableServiceList: public iObject
+{
+#ifdef SWIG
+ iMutableServiceList();
+ ~iMutableServiceList();
+#endif
+public:
+ /* flush changes */
+ virtual RESULT flushChanges()=0;
+ /* adds a service to a list */
+ virtual RESULT addService(eServiceReference &ref, eServiceReference before=eServiceReference())=0;
+ /* removes a service from a list */
+ virtual RESULT removeService(eServiceReference &ref)=0;
+ /* moves a service in a list, only if list suppports a specific sort method. */
+ /* pos is the new, absolute position from 0..size-1 */
+ virtual RESULT moveService(eServiceReference &ref, int pos)=0;
+ /* set name of list, for bouquets this is the visible bouquet name */
+ virtual RESULT setListName(const std::string &name)=0;
+};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iMutableServiceList>, iMutableServiceListPtr);
-class iPlayableService: public iObject
+SWIG_IGNORE(iListableService);
+class iListableService: public iObject
{
#ifdef SWIG
- iPlayableService();
- ~iPlaybleService();
+ iListableService();
+ ~iListableService();
#endif
- friend class iServiceHandler;
public:
- enum
+#ifndef SWIG
+ /* legacy interface: get a list */
+ virtual RESULT getContent(std::list<eServiceReference> &list, bool sorted=false)=0;
+#endif
+ virtual PyObject *getContent(const char* format, bool sorted=false)=0;
+
+ /* new, shiny interface: streaming. */
+ virtual SWIG_VOID(RESULT) getNext(eServiceReference &SWIG_OUTPUT)=0;
+
+ /* use this for sorting. output is not sorted because of either
+ - performance reasons: the whole list must be buffered or
+ - the interface would be restricted to a list. streaming
+ (as well as a future "active" extension) won't be possible.
+ */
+ virtual int compareLessEqual(const eServiceReference &, const eServiceReference &)=0;
+
+ virtual SWIG_VOID(RESULT) startEdit(ePtr<iMutableServiceList> &SWIG_OUTPUT)=0;
+};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iListableService>, iListableServicePtr);
+
+#ifndef SWIG
+ /* a helper class which can be used as argument to stl's sort(). */
+class iListableServiceCompare
+{
+ ePtr<iListableService> m_list;
+public:
+ iListableServiceCompare(iListableService *list): m_list(list) { }
+ bool operator()(const eServiceReference &a, const eServiceReference &b)
{
+ return m_list->compareLessEqual(a, b);
+ }
+};
+#endif
+
+SWIG_IGNORE(iServiceOfflineOperations);
+class iServiceOfflineOperations: public iObject
+{
+#ifdef SWIG
+ iServiceOfflineOperations();
+ ~iServiceOfflineOperations();
+#endif
+public:
+ /* to delete a service, forever. */
+ virtual RESULT deleteFromDisk(int simulate=1)=0;
+
+ /* for transferring a service... */
+ virtual SWIG_VOID(RESULT) getListOfFilenames(std::list<std::string> &SWIG_OUTPUT)=0;
+
+ // TODO: additional stuff, like a conversion interface?
+};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iServiceOfflineOperations>, iServiceOfflineOperationsPtr);
+
+class iPlayableService_ENUMS
+{
+#ifdef SWIG
+ iPlayableService_ENUMS();
+ ~iPlayableService_ENUMS();
+#endif
+public:
+ enum {
/* these first two events are magical, and should only
be generated if you know what you're doing. */
evStart,
evEnd,
-
+
evTuneFailed,
- // when iServiceInformation is implemented:
+
+ /* when iServiceInformation is implemented:*/
evUpdatedEventInfo,
evUpdatedInfo,
- /* when seek() is implemented: */
+ /* when seek() is implemented: */
evSeekableStatusChanged, /* for example when timeshifting */
-
+
evEOF,
evSOF, /* bounced against start of file (when seeking backwards) */
-
- /* only when cueSheet is implemented */
+
+ /* when cueSheet is implemented */
evCuesheetChanged,
+ /* when radioText is implemented */
evUpdatedRadioText,
evVideoSizeChanged
};
+};
+
+SWIG_IGNORE(iPlayableService);
+class iPlayableService: public iPlayableService_ENUMS, public iObject
+{
+#ifdef SWIG
+ iPlayableService();
+ ~iPlaybleService();
+#endif
+ friend class iServiceHandler;
+public:
#ifndef SWIG
virtual RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)=0;
#endif
virtual SWIG_VOID(RESULT) audioDelay(ePtr<iAudioDelay> &SWIG_OUTPUT)=0;
virtual SWIG_VOID(RESULT) radioText(ePtr<iRadioText> &SWIG_OUTPUT)=0;
};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iPlayableService>, iPlayableServicePtr);
-TEMPLATE_TYPEDEF(ePtr<iPlayableService>, iPlayableServicePtr);
-
-class iRecordableService: public iObject
+class iRecordableService_ENUMS
{
#ifdef SWIG
- iRecordableService();
- ~iRecordableService();
+ iRecordableService_ENUMS();
+ ~iRecordableService_ENUMS();
#endif
public:
- enum
- {
+ enum {
evStart,
evStop,
evTunedIn,
evRecordStopped,
evNewProgramInfo,
evRecordFailed
-// evDiskFull
+ /*evDiskFull*/
};
- enum
- {
+ enum {
NoError=0,
errOpenRecordFile=-1,
errNoDemuxAvailable=-2,
errDiskFull=-4,
errTuneFailed=-255
};
+};
+
+SWIG_IGNORE(iRecordableService);
+class iRecordableService: public iRecordableService_ENUMS, public iObject
+{
+#ifdef SWIG
+ iRecordableService();
+ ~iRecordableService();
+#endif
+public:
#ifndef SWIG
virtual RESULT connectEvent(const Slot2<void,iRecordableService*,int> &event, ePtr<eConnection> &connection)=0;
#endif
virtual RESULT stop()=0;
virtual SWIG_VOID(RESULT) frontendInfo(ePtr<iFrontendInformation> &SWIG_OUTPUT)=0;
};
-
-TEMPLATE_TYPEDEF(ePtr<iRecordableService>, iRecordableServicePtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<iRecordableService>, iRecordableServicePtr);
extern PyObject *New_iRecordableServicePtr(const ePtr<iRecordableService> &ref); // defined in enigma_python.i
#endif
#endif // SWIG
-// TEMPLATE_TYPEDEF(std::list<eServiceReference>, eServiceReferenceList);
-
-class iMutableServiceList: public iObject
-{
-#ifdef SWIG
- iMutableServiceList();
- ~iMutableServiceList();
-#endif
-public:
- /* flush changes */
- virtual RESULT flushChanges()=0;
- /* adds a service to a list */
- virtual RESULT addService(eServiceReference &ref, eServiceReference before=eServiceReference())=0;
- /* removes a service from a list */
- virtual RESULT removeService(eServiceReference &ref)=0;
- /* moves a service in a list, only if list suppports a specific sort method. */
- /* pos is the new, absolute position from 0..size-1 */
- virtual RESULT moveService(eServiceReference &ref, int pos)=0;
- /* set name of list, for bouquets this is the visible bouquet name */
- virtual RESULT setListName(const std::string &name)=0;
-};
-
-TEMPLATE_TYPEDEF(ePtr<iMutableServiceList>, iMutableServiceListPtr);
-
-class iListableService: public iObject
-{
-#ifdef SWIG
- iListableService();
- ~iListableService();
-#endif
-public:
-#ifndef SWIG
- /* legacy interface: get a list */
- virtual RESULT getContent(std::list<eServiceReference> &list, bool sorted=false)=0;
-#endif
- virtual PyObject *getContent(const char* format, bool sorted=false)=0;
-
- /* new, shiny interface: streaming. */
- virtual SWIG_VOID(RESULT) getNext(eServiceReference &SWIG_OUTPUT)=0;
-
- /* use this for sorting. output is not sorted because of either
- - performance reasons: the whole list must be buffered or
- - the interface would be restricted to a list. streaming
- (as well as a future "active" extension) won't be possible.
- */
- virtual int compareLessEqual(const eServiceReference &, const eServiceReference &)=0;
-
- virtual SWIG_VOID(RESULT) startEdit(ePtr<iMutableServiceList> &SWIG_OUTPUT)=0;
-};
-
-TEMPLATE_TYPEDEF(ePtr<iListableService>, iListableServicePtr);
-
-#ifndef SWIG
- /* a helper class which can be used as argument to stl's sort(). */
-class iListableServiceCompare
-{
- ePtr<iListableService> m_list;
-public:
- iListableServiceCompare(iListableService *list): m_list(list) { }
- bool operator()(const eServiceReference &a, const eServiceReference &b)
- {
- return m_list->compareLessEqual(a, b);
- }
-};
-#endif
-
-class iServiceOfflineOperations: public iObject
-{
-#ifdef SWIG
- iServiceOfflineOperations();
- ~iServiceOfflineOperations();
-#endif
-public:
- /* to delete a service, forever. */
- virtual RESULT deleteFromDisk(int simulate=1)=0;
-
- /* for transferring a service... */
- virtual SWIG_VOID(RESULT) getListOfFilenames(std::list<std::string> &SWIG_OUTPUT)=0;
-
- // TODO: additional stuff, like a conversion interface?
-};
-
-TEMPLATE_TYPEDEF(ePtr<iServiceOfflineOperations>, iServiceOfflineOperationsPtr);
-
+SWIG_IGNORE(iServiceHandler);
class iServiceHandler: public iObject
{
#ifdef SWIG
virtual SWIG_VOID(RESULT) info(const eServiceReference &, ePtr<iStaticServiceInformation> &SWIG_OUTPUT)=0;
virtual SWIG_VOID(RESULT) offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &SWIG_OUTPUT)=0;
};
-
-TEMPLATE_TYPEDEF(ePtr<iServiceHandler>, iServiceHandlerPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<iServiceHandler>, iServiceHandlerPtr);
#endif
class eServiceCenter;
+#ifndef SWIG
typedef ePtr<eServiceCenter> eServiceCenterPtr;
+#endif
class eServiceCenter: public iServiceHandler
{
DECLARE_REF(eServiceCenter);
private:
- std::map<int,iServiceHandlerPtr> handler;
+ std::map<int,ePtr<iServiceHandler> > handler;
static eServiceCenter *instance;
#ifdef SWIG
eServiceCenter();
#ifndef SWIG
eServiceCenter();
virtual ~eServiceCenter();
-#endif
+
// iServiceHandler
- RESULT play(const eServiceReference &, iPlayableServicePtr &ptr);
- RESULT record(const eServiceReference &, iRecordableServicePtr &ptr);
- RESULT list(const eServiceReference &, iListableServicePtr &ptr);
+ RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr);
+ RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
+ RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr);
RESULT offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr);
// eServiceCenter
- static RESULT getPrivInstance(eServiceCenterPtr &ptr) { ptr = instance; return 0; }
- static SWIG_VOID(RESULT) getInstance(iServiceHandlerPtr &SWIG_NAMED_OUTPUT(ptr)) { ptr = instance; return 0; }
+ static RESULT getPrivInstance(ePtr<eServiceCenter> &ptr) { ptr = instance; return 0; }
RESULT addServiceFactory(int id, iServiceHandler *hnd);
RESULT removeServiceFactory(int id);
+#endif
+ static SWIG_VOID(RESULT) getInstance(ePtr<iServiceHandler> &SWIG_NAMED_OUTPUT(ptr)) { ptr = instance; return 0; }
};
#endif
from Tools import RedirectOutput
-from enigma import *
+from enigma import runMainloop, eDVBDB, eTimer, quitMainloop, eDVBVolumecontrol, \
+ getDesktop, ePythonConfigQuery, eAVSwitch, eWindow
from tools import *
from Components.Language import language
language.addCallback(setEPGLanguage)
-import traceback
+from traceback import print_exc
import Screens.InfoBar
from Screens.SimpleSummary import SimpleSummary
-import sys
-import time
+from sys import stdout, exc_info
import ServiceReference
from skin import readSkin, applyAllAttributes
from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE
-from Components.config import config, ConfigText, configfile, ConfigSubsection, ConfigInteger
+from Components.config import config, configfile, ConfigText, ConfigSubsection, ConfigInteger
InitFallbackFiles()
eDVBDB.getInstance().reloadBouquets()
try:
return screen(self, *arguments, **kwargs)
except:
- errstr = "Screen %s(%s, %s): %s" % (str(screen), str(arguments), str(kwargs), sys.exc_info()[0])
+ errstr = "Screen %s(%s, %s): %s" % (str(screen), str(arguments), str(kwargs), exc_info()[0])
print errstr
- traceback.print_exc(file=sys.stdout)
+ print_exc(file=stdout)
quitMainloop(5)
def instantiateDialog(self, screen, *arguments, **kwargs):
except:
print 'EXCEPTION IN DIALOG INIT CODE, ABORTING:'
print '-'*60
- traceback.print_exc(file=sys.stdout)
+ print_exc(file=stdout)
quitMainloop(5)
print '-'*60
runReactor()
configfile.save()
-
- from Tools.DreamboxHardware import setFPWakeuptime
+
from time import time
+ from Tools.DreamboxHardware import setFPWakeuptime
nextRecordingTime = session.nav.RecordTimer.getNextRecordingTime()
if nextRecordingTime != -1:
if (nextRecordingTime - time() < 330): # no time to switch box back on
except:
print 'EXCEPTION IN PYTHON STARTUP CODE:'
print '-'*60
- traceback.print_exc(file=sys.stdout)
+ print_exc(file=stdout)
quitMainloop(5)
print '-'*60
-from enigma import *
import xml.dom.minidom
from xml.dom import EMPTY_NAMESPACE
-from Tools.Import import my_import
-import os
+from os import path
+
+from enigma import eSize, ePoint, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, \
+ loadPNG, addFont, gRGB, eWindowStyleSkinned
from Components.config import ConfigSubsection, ConfigText, config
from Components.Element import Element
from Components.Converter.Converter import Converter
-
+from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS
+from Tools.Import import my_import
from Tools.XMLTools import elementsWithTag, mergeText
colorNames = dict()
except:
None
-from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS
-
class SkinError(Exception):
def __init__(self, message):
self.message = message
def loadSkin(name):
# read the skin
filename = resolveFilename(SCOPE_SKIN, name)
- path = os.path.dirname(filename) + "/"
- dom_skins.append((path, xml.dom.minidom.parse(filename)))
+ mpath = path.dirname(filename) + "/"
+ dom_skins.append((mpath, xml.dom.minidom.parse(filename)))
# we do our best to always select the "right" value
# skins are loaded in order of priority: skin with
except:
raise ("Unknown color %s" % (type))
- x = eWindowStyleManagerPtr()
- eWindowStyleManager.getInstance(x)
+ x = eWindowStyleManager.getInstance()
x.setStyle(id, style)
def loadSkinData(desktop):
-import bisect
-import time
-import calendar
-from enigma import *
+from bisect import insort
+from time import strftime, time, localtime, gmtime, mktime
+from calendar import timegm
+from enigma import eTimer
class TimerEntry:
StateWaiting = 0
def processRepeated(self):
print "ProcessRepeated"
if (self.repeated != 0):
- now = int(time.time()) + 1
+ now = int(time()) + 1
#to avoid problems with daylight saving, we need to calculate with localtime, in struct_time representation
- localbegin = time.localtime(self.begin)
- localend = time.localtime(self.end)
- localnow = time.localtime(now)
+ localbegin = localtime(self.begin)
+ localend = localtime(self.end)
+ localnow = localtime(now)
- print time.strftime("%c", localbegin)
- print time.strftime("%c", localend)
+ print strftime("%c", localbegin)
+ print strftime("%c", localend)
day = []
flags = self.repeated
day.append(1)
flags = flags >> 1
- print time.strftime("%c", localnow)
+ print strftime("%c", localnow)
while ((day[localbegin.tm_wday] != 0) or ((day[localbegin.tm_wday] == 0) and localend < localnow)):
- print time.strftime("%c", localbegin)
- print time.strftime("%c", localend)
+ print strftime("%c", localbegin)
+ print strftime("%c", localend)
#add one day to the struct_time, we have to convert using gmt functions, because the daylight saving flag might change after we add our 86400 seconds
- localbegin = time.gmtime(calendar.timegm(localbegin) + 86400)
- localend = time.gmtime(calendar.timegm(localend) + 86400)
+ localbegin = gmtime(timegm(localbegin) + 86400)
+ localend = gmtime(timegm(localend) + 86400)
#we now have a struct_time representation of begin and end in localtime, but we have to calculate back to (gmt) seconds since epoch
- self.begin = int(time.mktime(localbegin))
- self.end = int(time.mktime(localend)) + 1
+ self.begin = int(mktime(localbegin))
+ self.end = int(mktime(localend)) + 1
print "ProcessRepeated result"
- print time.strftime("%c", time.localtime(self.begin))
- print time.strftime("%c", time.localtime(self.end))
+ print strftime("%c", localtime(self.begin))
+ print strftime("%c", localtime(self.end))
self.timeChanged()
# check if a timer entry must be skipped
def shouldSkip(self):
- return self.end <= time.time() and self.state == TimerEntry.StateWaiting
+ return self.end <= time() and self.state == TimerEntry.StateWaiting
def abort(self):
- self.end = time.time()
+ self.end = time()
# in case timer has not yet started, but gets aborted (so it's preparing),
# set begin to now.
self.timer = eTimer()
self.timer.timeout.get().append(self.calcNextActivation)
- self.lastActivation = time.time()
+ self.lastActivation = time()
self.calcNextActivation()
self.on_state_change = [ ]
print "shouldSkip:", entry.shouldSkip()
print "state == ended", entry.state == TimerEntry.StateEnded
print "waiting && disabled:", (entry.state == TimerEntry.StateWaiting and entry.disabled)
- bisect.insort(self.processed_timers, entry)
+ insort(self.processed_timers, entry)
entry.state = TimerEntry.StateEnded
else:
- bisect.insort(self.timer_list, entry)
+ insort(self.timer_list, entry)
if not noRecalc:
self.calcNextActivation()
def setNextActivation(self, when):
- delay = int((when - time.time()) * 1000)
+ delay = int((when - time()) * 1000)
print "[timer.py] next activation: %d (in %d ms)" % (when, delay)
self.timer.start(delay, 1)
self.next = when
def calcNextActivation(self):
- if self.lastActivation > time.time():
+ if self.lastActivation > time():
print "[timer.py] timewarp - re-evaluating all processed timers."
tl = self.processed_timers
self.processed_timers = [ ]
self.addTimerEntry(x, noRecalc=1)
self.processActivation()
- self.lastActivation = time.time()
+ self.lastActivation = time()
- min = int(time.time()) + self.MaxWaitTime
+ min = int(time()) + self.MaxWaitTime
# calculate next activation point
if len(self.timer_list):
# did this timer reached the last state?
if w.state < TimerEntry.StateEnded:
# no, sort it into active list
- bisect.insort(self.timer_list, w)
+ insort(self.timer_list, w)
else:
# yes. Process repeated, and re-add.
if w.repeated:
w.state = TimerEntry.StateWaiting
self.addTimerEntry(w)
else:
- bisect.insort(self.processed_timers, w)
+ insort(self.processed_timers, w)
self.stateChanged(w)
def processActivation(self):
- print "It's now ", time.strftime("%c", time.localtime(time.time()))
- t = int(time.time()) + 1
+ print "It's now ", strftime("%c", localtime(time()))
+ t = int(time()) + 1
# we keep on processing the first entry until it goes into the future.
while len(self.timer_list) and self.timer_list[0].getNextActivation() < t: