some python import cleanups
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 19 Dec 2006 02:12:57 +0000 (02:12 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 19 Dec 2006 02:12:57 +0000 (02:12 +0000)
lesser swig overhead

81 files changed:
Navigation.py
ServiceReference.py
keymapparser.py
lib/actions/action.cpp
lib/actions/action.h
lib/base/ebase.h
lib/driver/etimezone.cpp
lib/driver/etimezone.h
lib/dvb/db.h
lib/dvb/dvb.cpp
lib/dvb/dvb.h
lib/dvb/idvb.h
lib/gdi/gpixmap.h
lib/gui/elistboxcontent.h
lib/gui/ewidget.h
lib/gui/ewindowstyle.cpp
lib/gui/ewindowstyle.h
lib/gui/ewindowstyleskinned.h
lib/python/Components/AVSwitch.py
lib/python/Components/About.py
lib/python/Components/ActionMap.py
lib/python/Components/ChoiceList.py
lib/python/Components/Clock.py
lib/python/Components/ConditionalWidget.py
lib/python/Components/EpgList.py
lib/python/Components/FileList.py
lib/python/Components/Harddisk.py
lib/python/Components/Language.py
lib/python/Components/LanguageList.py
lib/python/Components/MediaPlayer.py
lib/python/Components/MovieList.py
lib/python/Components/MultiContent.py
lib/python/Components/Network.py
lib/python/Components/ParentalControlList.py
lib/python/Components/PluginComponent.py
lib/python/Components/PluginList.py
lib/python/Components/RFmod.py
lib/python/Components/ServiceList.py
lib/python/Components/ServicePosition.py
lib/python/Components/TimerList.py
lib/python/Components/Timezones.py
lib/python/Components/components.py
lib/python/Makefile.am
lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py
lib/python/Plugins/Extensions/CutListEditor/plugin.py
lib/python/Plugins/Extensions/FileManager/plugin.py
lib/python/Plugins/Extensions/MediaScanner/plugin.py
lib/python/Plugins/Extensions/PicturePlayer/plugin.py
lib/python/Plugins/Extensions/SimpleRSS/plugin.py
lib/python/Plugins/Extensions/TuxboxPlugins/plugin.py
lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py
lib/python/Plugins/SystemPlugins/OldSoftwareUpdate/plugin.py
lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py
lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
lib/python/Plugins/SystemPlugins/SkinSelector/plugin.py
lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py
lib/python/Screens/ChannelSelection.py
lib/python/Screens/ChoiceBox.py
lib/python/Screens/Ci.py
lib/python/Screens/Dish.py
lib/python/Screens/EpgSelection.py
lib/python/Screens/EventView.py
lib/python/Screens/InfoBar.py
lib/python/Screens/InfoBarGenerics.py
lib/python/Screens/InputBox.py
lib/python/Screens/MediaPlayer.py
lib/python/Screens/PVRState.py
lib/python/Screens/ParentalControlSetup.py
lib/python/Screens/PiPSetup.py
lib/python/Screens/Scart.py
lib/python/Screens/Standby.py
lib/python/enigma_py_patcher.py [new file with mode: 0644]
lib/python/enigma_python.i
lib/python/python.h
lib/python/swig.h
lib/service/event.h
lib/service/iservice.h
lib/service/service.h
mytest.py
skin.py
timer.py

index 50cdf01..c2d2752 100644 (file)
@@ -1,4 +1,4 @@
-from enigma import *
+from enigma import eServiceCenter, eServiceReference, pNavigation
 from Components.ParentalControl import parentalControl
 from Tools.BoundFunction import boundFunction
 import RecordTimer
 from Components.ParentalControl import parentalControl
 from Tools.BoundFunction import boundFunction
 import RecordTimer
index 9dd316f..f7aa639 100644 (file)
@@ -1,5 +1,4 @@
-
-from enigma import *
+from enigma import eServiceReference, eServiceCenter
 
 import NavigationInstance
 
 
 import NavigationInstance
 
index 1a6a378..f8aa07f 100644 (file)
@@ -9,8 +9,7 @@ from Tools.KeyBindings import addKeyBinding
 
 def readKeymap():
 
 
 def readKeymap():
 
-       p = enigma.eActionMapPtr()
-       enigma.eActionMap.getInstance(p)
+       p = enigma.eActionMap.getInstance()
        assert p
        
        filename1 = "data/keymap.xml"
        assert p
        
        filename1 = "data/keymap.xml"
index 56ad89a..c1d2c19 100644 (file)
@@ -41,13 +41,6 @@ RESULT eActionMap::getInstance(ePtr<eActionMap> &ptr)
        return 0;
 }
 
        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;
 void eActionMap::bindAction(const std::string &context, int priority, int id, eWidget *widget)
 {
        eActionBinding bnd;
@@ -221,4 +214,11 @@ void eActionMap::keyPressed(const std::string &device, int key, int flags)
        }
 }
 
        }
 }
 
+ePtr<eActionMap> NewActionMapPtr(void)
+{
+       ePtr<eActionMap> ptr;
+       eActionMap::getInstance(ptr);
+       return ptr;
+}
+
 eAutoInitPtr<eActionMap> init_eActionMap(eAutoInitNumbers::actions, "eActionMap");
 eAutoInitPtr<eActionMap> init_eActionMap(eAutoInitNumbers::actions, "eActionMap");
index f2e0d8f..7bd7125 100644 (file)
@@ -13,6 +13,7 @@
 
 class eWidget;
 
 
 class eWidget;
 
+SWIG_IGNORE(eActionMap);
 class eActionMap: public iObject
 {
 DECLARE_REF(eActionMap);
 class eActionMap: public iObject
 {
 DECLARE_REF(eActionMap);
@@ -35,8 +36,8 @@ public:
        
        void keyPressed(const std::string &device, int key, int flags);
        
        
        void keyPressed(const std::string &device, int key, int flags);
        
-       static RESULT getInstance(ePtr<eActionMap> &ptr);
 #ifndef SWIG
 #ifndef SWIG
+       static RESULT getInstance(ePtr<eActionMap> &);
 private:
        static eActionMap *instance;
        struct eActionBinding
 private:
        static eActionMap *instance;
        struct eActionBinding
@@ -78,5 +79,13 @@ private:
        std::multimap<std::string, ePythonKeyBinding> m_python_keys;
 #endif
 };
        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
 
 #endif
index db93679..75b5820 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __ebase_h
 #define __ebase_h
 
 #ifndef __ebase_h
 #define __ebase_h
 
+#ifndef SWIG
 #include <vector>
 #include <map>
 #include <sys/poll.h>
 #include <vector>
 #include <map>
 #include <sys/poll.h>
@@ -9,8 +10,10 @@
 #include <time.h>
 
 #include <lib/base/eptrlist.h>
 #include <time.h>
 
 #include <lib/base/eptrlist.h>
-#include <lib/python/connections.h>
 #include <libsig_comp.h>
 #include <libsig_comp.h>
+#endif
+
+#include <lib/python/connections.h>
 
 class eApplication;
 
 
 class eApplication;
 
index 4accdba..25879ce 100644 (file)
@@ -1,8 +1,7 @@
 #include "etimezone.h"
 #include "etimezone.h"
-
 #include <time.h>
 
 #include <time.h>
 
-etimezone::etimezone()
+void e_tzset()
 {
        tzset();
 }
 {
        tzset();
 }
index 081bf13..7f1b2a8 100644 (file)
@@ -1,11 +1,7 @@
 #ifndef __etimezone_h
 #define __etimezone_h
 
 #ifndef __etimezone_h
 #define __etimezone_h
 
-class etimezone
-{
-public:
-       etimezone();
-};
+void e_tzset(void);
 
 #endif
 
 
 #endif
 
index 430a5af..34ecfc1 100644 (file)
@@ -2,8 +2,8 @@
 #define __db_h
 
 #ifndef SWIG
 #define __db_h
 
 #ifndef SWIG
-#include <lib/base/eptrlist.h>
 #include <lib/dvb/idvb.h>
 #include <lib/dvb/idvb.h>
+#include <lib/base/eptrlist.h>
 #include <set>
 class ServiceDescriptionSection;
 #endif
 #include <set>
 class ServiceDescriptionSection;
 #endif
index ecb0ec6..ad14654 100644 (file)
@@ -52,6 +52,13 @@ RESULT eDVBResourceManager::getInstance(ePtr<eDVBResourceManager> &ptr)
        return -1;
 }
 
        return -1;
 }
 
+ePtr<eDVBResourceManager> NewResourceManagerPtr(void)
+{
+       ePtr<eDVBResourceManager> ptr;
+       eDVBResourceManager::getInstance(ptr);
+       return ptr;
+}
+
 eDVBResourceManager::eDVBResourceManager()
        :m_releaseCachedChannelTimer(eApp)
 {
 eDVBResourceManager::eDVBResourceManager()
        :m_releaseCachedChannelTimer(eApp)
 {
index 037c197..95d1091 100644 (file)
@@ -125,9 +125,9 @@ private:
        eSmartPtrList<eDVBFrontend> m_frontend;
        eSmartPtrList<eDVBDemux>    m_demux;
 };
        eSmartPtrList<eDVBFrontend> m_frontend;
        eSmartPtrList<eDVBDemux>    m_demux;
 };
-
 #endif // SWIG
 
 #endif // SWIG
 
+SWIG_IGNORE(eDVBResourceManager);
 class eDVBResourceManager: public iObject, public Object
 {
        DECLARE_REF(eDVBResourceManager);
 class eDVBResourceManager: public iObject, public Object
 {
        DECLARE_REF(eDVBResourceManager);
@@ -197,23 +197,30 @@ public:
                errNoDemux    = -2,
                errChidNotFound = -3
        };
                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);
        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;
 #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
 {
        /* iDVBPVRChannel includes iDVBChannel. don't panic. */
 class eDVBChannel: public iDVBPVRChannel, public iFilePushScatterGather, public Object
 {
@@ -289,6 +296,6 @@ private:
        void AddUse();
        void ReleaseUse();
 };
        void AddUse();
        void ReleaseUse();
 };
-
 #endif // SWIG
 #endif // SWIG
+
 #endif
 #endif
index 9e78153..a34be98 100644 (file)
@@ -391,32 +391,31 @@ public:
 class iDVBSatelliteEquipmentControl;
 class eSecCommandList;
 
 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:
 {
 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
        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;
        virtual RESULT getState(int &SWIG_OUTPUT)=0;
-       enum {
-               toneOff, toneOn
-       };
        virtual RESULT setTone(int tone)=0;
        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 setVoltage(int voltage)=0;
        virtual RESULT sendDiseqc(const eDVBDiseqcCommand &diseqc)=0;
        virtual RESULT sendToneburst(int burst)=0;
@@ -424,12 +423,8 @@ public:
        virtual RESULT setSEC(iDVBSatelliteEquipmentControl *sec)=0;
        virtual RESULT setSecSequence(const eSecCommandList &list)=0;
 #endif
        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;
        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;
 #ifndef SWIG
        virtual RESULT getData(int num, int &data)=0;
        virtual RESULT setData(int num, int val)=0;
@@ -437,7 +432,7 @@ public:
        virtual int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm)=0;
 #endif
 };
        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
 
 #ifndef SWIG
 class iDVBSatelliteEquipmentControl: public iObject
@@ -454,9 +449,13 @@ struct eDVBCIRouting
 };
 #endif // SWIG
 
 };
 #endif // SWIG
 
+SWIG_IGNORE(iDVBChannel);
 class iDVBChannel: public iObject
 {
 public:
 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 */
        enum
        {
                state_idle,        /* not yet tuned */
@@ -467,12 +466,8 @@ public:
                state_last_instance, /* just one reference to this channel is left */
                state_release      /* channel is being shut down. */
        };
                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 RESULT getCurrentFrontendParameters(ePtr<iDVBFrontendParameters> &)=0;
        enum 
        {
@@ -495,10 +490,9 @@ public:
        virtual void ReleaseUse() = 0;
 #endif
 };
        virtual void ReleaseUse() = 0;
 #endif
 };
-TEMPLATE_TYPEDEF(eUsePtr<iDVBChannel>, iDVBChannelPtr);
+SWIG_TEMPLATE_TYPEDEF(eUsePtr<iDVBChannel>, iDVBChannelPtr);
 
 #ifndef SWIG
 
 #ifndef SWIG
-
        /* signed, so we can express deltas. */
        
 typedef long long pts_t;
        /* signed, so we can express deltas. */
        
 typedef long long pts_t;
index d717ec6..e3798bf 100644 (file)
@@ -107,17 +107,18 @@ struct gSurface
 
 class gRegion;
 
 
 class gRegion;
 
+SWIG_IGNORE(gPixmap);
 class gPixmap: public iObject
 {
        DECLARE_REF(gPixmap);
 public:
 class gPixmap: public iObject
 {
        DECLARE_REF(gPixmap);
 public:
+#ifndef SWIG
        enum
        {
                blitAlphaTest=1,
                blitAlphaBlend=2
        };
 
        enum
        {
                blitAlphaTest=1,
                blitAlphaBlend=2
        };
 
-#ifndef SWIG
        gPixmap(gSurface *surface);
        gPixmap(eSize, int bpp, int accel = 0);
 
        gPixmap(gSurface *surface);
        gPixmap(eSize, int bpp, int accel = 0);
 
@@ -128,14 +129,12 @@ public:
        
        gPixmap *lock();
        void unlock();
        
        gPixmap *lock();
        void unlock();
+       inline bool needClut() const { return surface && surface->bpp <= 8; }
 #endif
        virtual ~gPixmap();
 #endif
        virtual ~gPixmap();
-       
        eSize size() const { return eSize(surface->x, surface->y); }
        eSize size() const { return eSize(surface->x, surface->y); }
-       inline bool needClut() const { return surface && surface->bpp <= 8; }
 private:
        bool must_delete_surface;
 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);
        friend class gDC;
        void fill(const gRegion &clip, const gColor &color);
        void fill(const gRegion &clip, const gRGB &color);
@@ -144,12 +143,10 @@ private:
        
        void mergePalette(const gPixmap &target);
        void line(const gRegion &clip, ePoint start, ePoint end, gColor color);
        
        void mergePalette(const gPixmap &target);
        void line(const gRegion &clip, ePoint start, ePoint end, gColor color);
-#else
+#ifdef SWIG
        gPixmap();
 #endif
        gPixmap();
 #endif
-
 };
 };
-
-TEMPLATE_TYPEDEF(ePtr<gPixmap>, gPixmapPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<gPixmap>, gPixmapPtr);
 
 #endif
 
 #endif
index d86d592..9c89c65 100644 (file)
@@ -72,4 +72,15 @@ private:
        std::map<int, ePtr<gFont> > m_font;
 };
 
        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
 #endif
index f7c611f..98b3008 100644 (file)
@@ -34,7 +34,7 @@ public:
        
        void destruct();
        
        
        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);
        void setStyle(eWindowStyle *style) { m_style = style; }
        
        void setBackgroundColor(const gRGB &col);
index 2558669..68a74e0 100644 (file)
@@ -9,6 +9,13 @@ eWindowStyle::~eWindowStyle() {}
 
 DEFINE_REF(eWindowStyleManager);
 
 
 DEFINE_REF(eWindowStyleManager);
 
+ePtr<eWindowStyleManager> NewWindowStylePtr(void)
+{
+       ePtr<eWindowStyleManager> ptr;
+       eWindowStyleManager::getInstance(ptr);
+       return ptr;
+}
+
 eWindowStyleManager::eWindowStyleManager()
 {
        m_instance = this;
 eWindowStyleManager::eWindowStyleManager()
 {
        m_instance = this;
index 4824aad..91f2f0b 100644 (file)
@@ -7,13 +7,22 @@ class gFont;
 
 #include <lib/base/object.h>
 
 
 #include <lib/base/object.h>
 
+SWIG_IGNORE(eWindowStyle);
 class eWindowStyle: public iObject
 {
 class eWindowStyle: public iObject
 {
+#ifdef SWIG
+       eWindowStyle();
+#endif
 public:
 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 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,
        enum {
                styleLabel,
                styleListboxSelected,
@@ -22,8 +31,6 @@ public:
                styleListboxMarkedAndSelected
        };
        
                styleListboxMarkedAndSelected
        };
        
-       virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
-       
        enum {
                frameButton,
                frameListboxEntry
        enum {
                frameButton,
                frameListboxEntry
@@ -34,11 +41,10 @@ public:
                fontButton,
                fontTitlebar
        };
                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);
 class eWindowStyleManager: public iObject
 {
        DECLARE_REF(eWindowStyleManager);
@@ -51,16 +57,23 @@ public:
        eWindowStyleManager();
        ~eWindowStyleManager();
 #endif
        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);
        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;
 };
 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);
 class eWindowStyleSimple: public eWindowStyle
 {
        DECLARE_REF(eWindowStyleSimple);
@@ -78,5 +91,6 @@ public:
        void drawFrame(gPainter &painter, const eRect &frame, int what);
        RESULT getFont(int what, ePtr<gFont> &font);
 };
        void drawFrame(gPainter &painter, const eRect &frame, int what);
        RESULT getFont(int what, ePtr<gFont> &font);
 };
+#endif
 
 #endif
 
 #endif
index 1c16a7b..57c54a0 100644 (file)
@@ -8,12 +8,14 @@ class eWindowStyleSkinned: public eWindowStyle
        DECLARE_REF(eWindowStyleSkinned);
 public:
        eWindowStyleSkinned();
        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 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);
        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,
        
        enum {
                bsWindow,
index 8a7bd8d..a8e471b 100644 (file)
@@ -1,6 +1,6 @@
 from config import config, ConfigSelection, ConfigYesNo, ConfigEnableDisable, ConfigSubsection, ConfigBoolean
 import os
 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) }
 
 class AVSwitch:
        INPUT = { "ENCODER": (0, 4), "SCART": (1, 3), "AUX": (2, 4) }
index e5f9543..2f3fec0 100644 (file)
@@ -1,4 +1,4 @@
-from Tools.Directories import *
+from Tools.Directories import resolveFilename, SCOPE_SYSETC
 
 class About:
        def __init__(self):
 
 class About:
        def __init__(self):
index d2e908e..b65d6eb 100644 (file)
@@ -1,16 +1,15 @@
-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
 
 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
                self.bound = False
                self.exec_active = False
                self.enabled = True
-               eActionMap.getInstance(self.p)
-       
+
        def setEnabled(self, enabled):
                self.enabled = enabled
                self.checkBind()
        def setEnabled(self, enabled):
                self.enabled = enabled
                self.checkBind()
index a0fbde5..a2070c7 100644 (file)
@@ -1,20 +1,8 @@
 from HTMLComponent import *
 from GUIComponent import *
 from HTMLComponent import *
 from GUIComponent import *
-
 from MenuList import MenuList
 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 ]
 
 def ChoiceEntryComponent(key, text):
        res = [ text ]
index 95f29b1..9a6031e 100644 (file)
@@ -2,10 +2,7 @@ from HTMLComponent import *
 from GUIComponent import *
 from VariableText import *
 
 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 time
 # now some "real" components:
index 391b887..7d35d95 100644 (file)
@@ -1,7 +1,5 @@
-import skin
 from GUIComponent import *
 from GUIComponent import *
-
-from enigma import *
+from enigma import eTimer
 
 class ConditionalWidget(GUIComponent):
        def __init__(self, withTimer = True):
 
 class ConditionalWidget(GUIComponent):
        def __init__(self, withTimer = True):
@@ -61,7 +59,7 @@ class BlinkingWidget(GUIComponent):
                if self.visible:
                        self.hide()
                self.timer.stop()
                if self.visible:
                        self.hide()
                self.timer.stop()
-               
+
 class BlinkingWidgetConditional(BlinkingWidget, ConditionalWidget):
        def __init__(self):
                BlinkingWidget.__init__(self)
 class BlinkingWidgetConditional(BlinkingWidget, ConditionalWidget):
        def __init__(self):
                BlinkingWidget.__init__(self)
index 902968d..ca209bd 100644 (file)
@@ -2,7 +2,9 @@
 from HTMLComponent import *
 from GUIComponent import *
 
 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
 from re import *
 from time import localtime, time
 from ServiceReference import ServiceReference
@@ -12,17 +14,6 @@ EPG_TYPE_SINGLE = 0
 EPG_TYPE_MULTI = 1
 EPG_TYPE_SIMILAR = 2
 
 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
 class Rect:
        def __init__(self, x, y, width, height):
                self.__left = x
index 7621ccb..b85b8ea 100644 (file)
@@ -2,21 +2,14 @@ from HTMLComponent import *
 from GUIComponent import *
 import re
 
 from GUIComponent import *
 import re
 
+from os import path as os_path, listdir
 from MenuList import MenuList
 from Components.Harddisk import harddiskmanager
 
 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",
 
 EXTENSIONS = {
                "mp3": "music",
@@ -111,11 +104,11 @@ class FileList(MenuList, HTMLComponent, GUIComponent):
                        directories.sort()
                        files.sort()
                else:
                        directories.sort()
                        files.sort()
                else:
-                       files = os.listdir(directory)
+                       files = listdir(directory)
                        files.sort()
                        tmpfiles = files[:]
                        for x in tmpfiles:
                        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)
                
                                        directories.append(directory + x + "/")
                                        files.remove(x)
                
index f060c37..fee1ed7 100644 (file)
@@ -1,6 +1,6 @@
-import os
+from os import system
 
 
-from Tools.Directories import *
+from Tools.Directories import SCOPE_HDD, resolveFilename
 
 def tryOpen(filename):
        try:
 
 def tryOpen(filename):
        try:
@@ -105,7 +105,7 @@ class Harddisk:
 
        def unmount(self):
                cmd = "/bin/umount " + self.devidex + "part*"
 
        def unmount(self):
                cmd = "/bin/umount " + self.devidex + "part*"
-               res = os.system(cmd)
+               res = system(cmd)
                return (res >> 8)
 
        def createPartition(self):
                return (res >> 8)
 
        def createPartition(self):
@@ -117,16 +117,16 @@ class Harddisk:
 
        def mkfs(self):
                cmd = "/sbin/mkfs.ext3 -T largefile -m0 " + self.devidex + "part1"
 
        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"
                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):
                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")]
                return (res >> 8)
                
        errorList = [ _("Everything is fine"), _("Creating partition failed"), _("Mkfs failed"), _("Mount failed"), _("Create movie folder failed"), _("Unmount failed")]
index 1bbf0bc..a27f247 100644 (file)
@@ -1,7 +1,6 @@
 import gettext
 import gettext
-import os
 
 
-from Tools.Directories import *
+from Tools.Directories import SCOPE_LANGUAGE, resolveFilename
 
 class Language:
        def __init__(self):
 
 class Language:
        def __init__(self):
index e625d7c..e69de29 100644 (file)
@@ -1,41 +0,0 @@
-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)
index d88b628..44937fa 100644 (file)
@@ -3,19 +3,10 @@ from GUIComponent import *
 
 from MenuList import MenuList
 
 
 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
 
 STATE_PLAY = 0
 STATE_PAUSE = 1
@@ -32,7 +23,7 @@ ForwardIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_forward.png"))
 
 def PlaylistEntryComponent(serviceref, state):
        res = [ serviceref ]
 
 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
        png = None
        if state == STATE_PLAY:
                png = PlayIcon
index 1da5a51..dcd99fe 100644 (file)
@@ -1,13 +1,10 @@
 from GUIComponent import *
 from Tools.FuzzyDate import FuzzyTime
 from ServiceReference import ServiceReference
 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):
 
 class MovieList(GUIComponent):
        def __init__(self, root):
index 06ecde9..3031fb3 100644 (file)
@@ -1,15 +1,4 @@
-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 = ()
 
 def MultiContentEntryText(pos = (0, 0), size = (0, 0), font = 0, flags = RT_HALIGN_LEFT | RT_VALIGN_TOP, text = "", color = None):
        add = ()
index 5add0c0..f65863d 100644 (file)
@@ -81,14 +81,12 @@ class Network:
                        print "[Network.py] parsing network failed"
 
        def deactivateNetworkConfig(self):
                        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):
                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()
                os.system("/etc/init.d/networking start")
                config.network.ip.value = self.getCurrentIP()
                config.network.ip.save()
index 9791e1b..02e8800 100644 (file)
@@ -3,18 +3,9 @@ from GUIComponent import *
 
 from MenuList import MenuList
 from Components.ParentalControl import parentalControl
 
 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"))
 
 
 lockPicture = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "lock-fs8.png"))
 
index 120b463..9425e56 100644 (file)
@@ -1,8 +1,8 @@
-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
 
 from Tools.Import import my_import
 from Plugins.Plugin import PluginDescriptor
 
@@ -33,18 +33,18 @@ class PluginComponent:
        def readPluginList(self, directory):
                """enumerates plugins"""
                
        def readPluginList(self, directory):
                """enumerates plugins"""
                
-               categories = os.listdir(directory)
+               categories = os_listdir(directory)
                
                new_plugins = [ ]
                
                for c in categories:
                        directory_category = directory + c
                
                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()
                                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
                                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"]))
                                        if fileExists(path + "/plugin.pyc") or fileExists(path + "/plugin.py"):
                                                try:
                                                        plugin = my_import('.'.join(["Plugins", c, pluginname, "plugin"]))
@@ -56,7 +56,7 @@ class PluginComponent:
                                                        plugins = plugin.Plugins(path=path)
                                                except Exception, exc:
                                                        print "Plugin ", c + "/" + pluginname, "failed to load:", exc
                                                        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
                                                        print "skipping plugin."
                                                        self.warnings.append( (c + "/" + pluginname, str(exc)) )
                                                        continue
index 9b9cfea..fd98806 100644 (file)
@@ -4,9 +4,9 @@ from GUIComponent import *
 from MenuList import MenuList
 
 from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE
 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 ]
 
 def PluginEntryComponent(plugin):
        res = [ plugin ]
index 234ae4c..0ab4a81 100644 (file)
@@ -1,5 +1,5 @@
-from config import *
-from enigma import *
+from config import config, ConfigSelection, ConfigSubsection, ConfigOnOff, ConfigSlider
+from enigma import eRFmod
 
 # CHECK ME.
 RFMOD_CHANNEL_MIN = 21
 
 # CHECK ME.
 RFMOD_CHANNEL_MIN = 21
@@ -24,7 +24,7 @@ class RFmod:
 
 def InitRFmod():
 
 
 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)
        config.rfmod.enable = ConfigOnOff(default=False)
        config.rfmod.test = ConfigOnOff(default=False)
        config.rfmod.sound = ConfigOnOff(default=True)
index 6145ade..c2d58f2 100644 (file)
@@ -1,7 +1,7 @@
 from HTMLComponent import *
 from GUIComponent import *
 
 from HTMLComponent import *
 from GUIComponent import *
 
-from enigma import *
+from enigma import loadPNG, eListboxServiceContent, eListbox, eServiceCenter, eServiceReference, gFont, eRect
 
 from string import upper
 
 
 from string import upper
 
index d34d81f..6f7082d 100644 (file)
@@ -1,6 +1,6 @@
 from PerServiceDisplay import PerServiceDisplay, PerServiceBase
 from Components.GUIComponent import GUIComponent
 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):
 import time
 
 class ServicePosition(PerServiceDisplay, object):
index 2f60fcf..d2ccbb9 100644 (file)
@@ -4,22 +4,11 @@ from GUIComponent import *
 from Tools.FuzzyDate import FuzzyTime
 import time
 
 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
 
 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>  |
 #
 #  | <Service>     <Name of the Timer>  |
 #  | <start, end>              <state>  |
index 704b765..ccc9827 100644 (file)
@@ -4,8 +4,6 @@ from xml.sax.handler import ContentHandler
 import os
 import time
 
 import os
 import time
 
-from enigma import *
-
 class Timezones:
        class parseTimezones(ContentHandler):
                def __init__(self, timezones):
 class Timezones:
        class parseTimezones(ContentHandler):
                def __init__(self, timezones):
@@ -42,7 +40,8 @@ class Timezones:
                try:
                        time.tzset()
                except:
                try:
                        time.tzset()
                except:
-                       etimezone()
+                       from enigma import e_tzset
+                       e_tzset()
                
        def getTimezoneList(self):
                list = []
                
        def getTimezoneList(self):
                list = []
index 512defb..87159bf 100644 (file)
@@ -1,4 +1,3 @@
-from enigma import *
 import time
 import sys
 
 import time
 import sys
 
index 1cc0154..9eb13df 100644 (file)
@@ -10,7 +10,8 @@ libenigma_python_a_SOURCES = \
        python.cpp enigma_python_wrap.cxx connections.cpp
 
 enigma_python_wrap.cxx: enigma_python.i
        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
 
 
 installdir = $(LIBDIR)/enigma2/python
 
index e074aee..dae4d4a 100644 (file)
@@ -1,17 +1,13 @@
-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 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
 
 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" >
 class Test(Screen):
        skin = """
                <screen position="100,100" size="550,400" title="Test" >
index 28ed7d6..ba946f9 100644 (file)
@@ -5,11 +5,11 @@ from Screens.MessageBox import MessageBox
 from Components.ServicePosition import ServicePositionGauge
 from Components.ActionMap import HelpableActionMap
 from Components.MenuList import MenuList
 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 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 Screens.FixedMenu import FixedMenu
 import bisect
 
index d2b1971..3cbef34 100644 (file)
@@ -1,16 +1,9 @@
-from enigma import *
 from Screens.Screen import Screen
 from Screens.Screen import Screen
-from Screens.MessageBox import MessageBox
 from Components.ActionMap import NumberActionMap
 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
 
 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" >
 class FileManager(Screen):
        skin = """
                <screen position="100,100" size="550,400" title="Test" >
@@ -52,7 +45,7 @@ class FileManager(Screen):
                self["text"].right()
        
        def ok(self):
                self["text"].right()
        
        def ok(self):
-               
+       
                if self["list"].canDescent(): # isDir
                        self["list"].descent()
                else:
                if self["list"].canDescent(): # isDir
                        self["list"].descent()
                else:
index 5fc35ee..71f2f1c 100644 (file)
@@ -1,6 +1,6 @@
 from Plugins.Plugin import PluginDescriptor
 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('.')
 
 def getExtension(file):
        p = file.rfind('.')
@@ -9,7 +9,7 @@ def getExtension(file):
        else:
                ext = file[p+1:]
 
        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):
 
 class Scanner:
        def __init__(self, name, extensions = [], paths_to_scan = [], description = "", openfnc = None):
@@ -128,12 +128,12 @@ def ScanDevice(mountpoint):
 
        # now scan the paths    
        for p in paths_to_scan:
 
        # 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)
                        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)
 
                                for s in scanner:
                                        s.handleFile(res, pathname, ext)
 
index 8db85ce..34e8c10 100644 (file)
@@ -1,5 +1,4 @@
-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 Screens.Screen import Screen
 from Screens.ServiceInfo import ServiceInfoList, ServiceInfoListEntry
 from Components.ActionMap import ActionMap, NumberActionMap
@@ -15,7 +14,6 @@ from Components.AVSwitch import AVSwitch
 
 from Plugins.Plugin import PluginDescriptor
 
 
 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"))])
 config.pic = ConfigSubsection()
 config.pic.slidetime = ConfigInteger(default=10, limits=(5, 60))
 config.pic.resize = ConfigSelection(default="0", choices = [("0", _("simple")), ("1", _("better"))])
index 88db485..49da5e6 100644 (file)
@@ -6,9 +6,9 @@ from Screens.MessageBox import MessageBox
 from Components.ActionMap import ActionMap
 from Components.GUIComponent import GUIComponent
 from Components.Label import Label
 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 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
 
 from twisted.web import server
 from twisted.web.resource import Resource
index 8d4e158..5142d16 100644 (file)
@@ -1,14 +1,9 @@
 # must be fixed for the new plugin interface
 # 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
 
 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/"
 
 
 TUXBOX_PLUGINS_PATH = "/usr/lib/tuxbox/plugins/"
 
@@ -16,7 +11,7 @@ def getPlugins():
        pluginlist = []
 
        if pathExists(TUXBOX_PLUGINS_PATH):
        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":
        
                for x in dir:
                        if x[-3:] == "cfg":
index fae1f26..05a2824 100644 (file)
@@ -1,9 +1,7 @@
-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 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 Components.Pixmap import Pixmap
 from Components.Label import Label
 from Components.MenuList import MenuList
@@ -13,10 +11,9 @@ from Plugins.Plugin import PluginDescriptor
 
 from Tools.NumericalTextInput import *
 from Tools.Directories import *
 
 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 = ""
 
 
 plugin_path = ""
 
@@ -116,8 +113,8 @@ class BackupSetup(Screen):
        def createBackupfolders(self):
                self.path = BackupPath[self.backup.location.value]
                print "Creating Backup Folder if not already there..."
        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 Backup(self):
                print "this will start the backup now!"
@@ -129,10 +126,10 @@ class BackupSetup(Screen):
 
        def runBackup(self, result):
                if result:
 
        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()
                                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"
                                self.path = BackupPath[self.backup.location.value]
                                if self.backup.type.value == "full":
                                        print "Backup Mode: Full"
@@ -194,9 +191,9 @@ class RestoreMenu(Screen):
        def fill_list(self):
                self.flist = []
                self.path = BackupPath[self.backup.location.value]
        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
                        if (file.endswith(".tar.gz")):
                                self.flist.append((file))
                                self.entry = True
index 72279c1..0f6c4e8 100644 (file)
@@ -1,4 +1,4 @@
-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.Screen import Screen
 from Screens.MessageBox import MessageBox
 from Components.ActionMap import ActionMap, NumberActionMap
@@ -10,7 +10,7 @@ from Components.Input import Input
 from Screens.Console import Console
 from Plugins.Plugin import PluginDescriptor
 
 from Screens.Console import Console
 from Plugins.Plugin import PluginDescriptor
 
-import os
+from os import popen
 
 class Upgrade(Screen):
        skin = """
 
 class Upgrade(Screen):
        skin = """
@@ -43,7 +43,7 @@ class Upgrade(Screen):
                        self.close()
        
        def doUpdateDelay(self):
                        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
                string = ""
                for x in lines:
                        string += x
@@ -58,15 +58,6 @@ class Upgrade(Screen):
                else:
                        self.close()
 
                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 PacketEntryComponent(packet):
        res = [ packet ]
        
@@ -122,13 +113,13 @@ class Ipkg(Screen):
                
 
        def fillPacketList(self):
                
 
        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()])
                
                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:
                
                installedlist = {}
                for x in lines:
@@ -151,7 +142,7 @@ class Ipkg(Screen):
                        self.close()
        
        def doUpdateDelay(self):
                        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
                string = ""
                for x in lines:
                        string += x
index 4d9e611..db16f77 100644 (file)
@@ -1,4 +1,4 @@
-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
 from Screens.Screen import Screen
 from Screens.ScanSetup import ScanSetup
 from Screens.MessageBox import MessageBox
@@ -140,12 +140,12 @@ class PositionerSetup(Screen):
                return self.frontend
 
        def openFrontend(self):
                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"
                                        return True
                                else:
                                        print "getFrontend failed"
@@ -446,8 +446,8 @@ class TunerScreen(ScanSetup):
                        self.createSetup()
 
        def createConfig(self, foo):
                        self.createSetup()
 
        def createConfig(self, foo):
+               global tuning
                if not tuning:
                if not tuning:
-                       global tuning
                        tuning = ConfigSubsection()
                        tuning.type = ConfigSelection(
                                default = "manual_transponder",
                        tuning = ConfigSubsection()
                        tuning.type = ConfigSelection(
                                default = "manual_transponder",
index 6325a82..89fbc4b 100644 (file)
@@ -1,4 +1,4 @@
-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
 from Screens.Screen import Screen
 from Screens.ScanSetup import ScanSetup
 from Screens.MessageBox import MessageBox
@@ -56,12 +56,12 @@ class Satfinder(ScanSetup):
                </screen>"""
 
        def openFrontend(self):
                </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"
                                        return True
                                else:
                                        print "getFrontend failed"
index 844b75f..18ffd99 100755 (executable)
@@ -1,22 +1,17 @@
 # -*- 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!
 # -*- 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 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.MenuList import MenuList
 from Plugins.Plugin import PluginDescriptor
-
 from Components.config import config
 from Tools.Directories import SCOPE_SKIN
 from Components.config import config
 from Tools.Directories import SCOPE_SKIN
-
 from Components.config import config
 
 from Components.config import config
 
-import os, sys
+from os import path, walk
 
 class SkinSelector(Screen):
        # for i18n:
 
 class SkinSelector(Screen):
        # for i18n:
@@ -40,7 +35,7 @@ class SkinSelector(Screen):
                self.session = session
                self.previewPath = ""
 
                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)
 
                self.skinlist.sort()
                self["SkinList"] = MenuList(self.skinlist)
@@ -107,7 +102,7 @@ class SkinSelector(Screen):
                else:
                        pngpath = self.root+self["SkinList"].getCurrent()+"/prev.png"
 
                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"
 
                        # FIXME: don't use hardcoded path
                        pngpath = "/usr/lib/enigma2/python/Plugins/SystemPlugins/SkinSelector/noprev.png"
 
index dc494e6..b5034b6 100644 (file)
@@ -1,4 +1,4 @@
-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 Screens.Screen import Screen
 from Screens.MessageBox import MessageBox
 from Components.ActionMap import ActionMap, NumberActionMap
@@ -14,7 +14,7 @@ from Components.Ipkg import Ipkg
 from Components.Slider import Slider
 from Components.Label import Label
 
 from Components.Slider import Slider
 from Components.Label import Label
 
-import os
+from os import popen
 
 class UpdatePluginMenu(Screen):
        skin = """
 
 class UpdatePluginMenu(Screen):
        skin = """
@@ -125,15 +125,6 @@ class IPKGSource(Screen):
                print "pressed", number
                self["text"].number(number)
 
                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 PacketEntryComponent(packet):
        res = [ packet ]
        
@@ -189,13 +180,13 @@ class Ipkg2(Screen):
                
 
        def fillPacketList(self):
                
 
        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()])
                
                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:
                
                installedlist = {}
                for x in lines:
@@ -218,7 +209,7 @@ class Ipkg2(Screen):
                        self.close()
        
        def doUpdateDelay(self):
                        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
                string = ""
                for x in lines:
                        string += x
index 0eff596..9cbb422 100644 (file)
@@ -5,7 +5,7 @@ from Components.ActionMap import NumberActionMap, ActionMap
 from Components.MenuList import MenuList
 from Components.ServiceEventTracker import ServiceEventTracker
 from EpgSelection import EPGSelection
 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 Components.config import config, ConfigSubsection, ConfigText
 from Screens.FixedMenu import FixedMenu
 from Tools.NumericalTextInput import NumericalTextInput
index a20983e..3772988 100644 (file)
@@ -1,14 +1,10 @@
-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 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
 
 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)
 class ChoiceBox(Screen):
        def __init__(self, session, title = "", list = [], keys = None, selection = 0):
                Screen.__init__(self, session)
index c3302a1..27ca5aa 100644 (file)
@@ -6,8 +6,6 @@ from Components.Header import Header
 from Components.Button import Button
 from Components.Label import Label
 
 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.config import config, ConfigSubsection, ConfigSelection, ConfigSubList, getConfigListEntry, KEY_LEFT, KEY_RIGHT, KEY_0, ConfigNothing, ConfigPIN
 from Components.ConfigList import ConfigList
 
index bcc3580..a34f0c5 100644 (file)
@@ -5,7 +5,7 @@ from Components.Pixmap import Pixmap
 from Components.Button import Button
 from Components.config import config
 
 from Components.Button import Button
 from Components.config import config
 
-from enigma import *
+from enigma import eDVBSatelliteEquipmentControl
 
 class Dish(Screen):
        def __init__(self, session):
 
 class Dish(Screen):
        def __init__(self, session):
index 5d29df0..0483f98 100644 (file)
@@ -7,7 +7,7 @@ from Components.ActionMap import ActionMap
 from Components.ScrollLabel import ScrollLabel
 from Screens.EventView import EventViewSimple
 from TimeDateInput import TimeDateInput
 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 Screens.FixedMenu import FixedMenu
 from RecordTimer import RecordTimerEntry, parseEvent
 from TimerEdit import TimerEditList
index 82bca9f..8504165 100644 (file)
@@ -3,7 +3,7 @@ from Components.ActionMap import ActionMap
 from Components.Button import Button
 from Components.Label import Label
 from Components.ScrollLabel import ScrollLabel
 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 ServiceReference import ServiceReference
 from RecordTimer import RecordTimerEntry, parseEvent
 from TimerEntry import TimerEntry
index f112384..24c2b40 100644 (file)
@@ -4,10 +4,9 @@ from Screens.MovieSelection import MovieSelection
 from Screens.ChannelSelection import ChannelSelectionRadio
 from Screens.MessageBox import MessageBox
 from Screens.Ci import CiHandler
 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.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 Components.config import config
 
 from Tools.Notifications import AddNotificationWithCallback
@@ -23,10 +22,6 @@ from Screens.InfoBarGenerics import InfoBarShowHide, \
 
 from Screens.HelpMenu import HelpableScreen, HelpMenu
 
 
 from Screens.HelpMenu import HelpableScreen, HelpMenu
 
-from enigma import *
-
-import time
-
 class InfoBar(InfoBarShowHide,
        InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRadioText,
        InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, 
 class InfoBar(InfoBarShowHide,
        InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRadioText,
        InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, 
index 26bc0d4..646419c 100644 (file)
@@ -36,14 +36,14 @@ from Screens.SleepTimerEdit import SleepTimerEdit
 from ServiceReference import ServiceReference
 
 from Tools import Notifications
 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
 
 # hack alert!
 from Menu import MainMenu, mdom
@@ -953,7 +953,6 @@ class InfoBarTimeshift:
                        print "hu, timeshift already enabled?"
                else:
                        if not ts.startTimeshift():
                        print "hu, timeshift already enabled?"
                else:
                        if not ts.startTimeshift():
-                               import time
                                self.timeshift_enabled = 1
 
                                # we remove the "relative time" for now.
                                self.timeshift_enabled = 1
 
                                # we remove the "relative time" for now.
@@ -1240,8 +1239,8 @@ class InfoBarInstantRecord:
                except:
                        pass
 
                except:
                        pass
 
-               begin = time.time()
-               end = time.time() + 3600 * 10
+               begin = time()
+               end = time() + 3600 * 10
                name = "instant record"
                description = ""
                eventid = None
                name = "instant record"
                description = ""
                eventid = None
@@ -1320,7 +1319,7 @@ class InfoBarInstantRecord:
 
        def instantRecord(self):
                try:
 
        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
                except:
                        self.session.open(MessageBox, _("No HDD found or HDD not initialized!"), MessageBox.TYPE_ERROR)
                        return
@@ -1536,8 +1535,8 @@ class InfoBarAdditionalInfo:
                self["ExtensionsAvailable"] = Boolean(fixed=1)
 
                self.session.nav.event.append(self.gotServiceEvent) # we like to get service events
                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):
                        res_mgr.frontendUseMaskChanged.get().append(self.tunerUseMaskChanged)
 
        def tunerUseMaskChanged(self, mask):
@@ -1729,7 +1728,7 @@ class InfoBarCueSheetSupport:
                        return None
 
        def addMark(self, point):
                        return None
 
        def addMark(self, point):
-               bisect.insort(self.cut_list, point)
+               insort(self.cut_list, point)
                self.uploadCuesheet()
 
        def removeMark(self, point):
                self.uploadCuesheet()
 
        def removeMark(self, point):
index bb8b63d..6cdb42e 100644 (file)
@@ -1,15 +1,12 @@
-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 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
 
 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)
 class InputBox(Screen):
        def __init__(self, session, title = "", windowTitle = _("Input"), **kwargs):
                Screen.__init__(self, session)
@@ -165,4 +162,4 @@ class PinInput(InputBox):
                self.triesEntry.tries.save()
                                
        def showTries(self):
                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()))
index 1411b42..4e299b2 100644 (file)
@@ -4,7 +4,6 @@ from Screens.MessageBox import MessageBox
 from Components.ActionMap import NumberActionMap
 from Components.Label import Label
 from Components.Input import Input
 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.Pixmap import Pixmap
 from Components.Label import Label
 from Components.FileList import FileEntryComponent, FileList
index b2c8a4d..f7b2abf 100644 (file)
@@ -3,8 +3,6 @@ from Screen import Screen
 from Components.Label import Label
 from Components.Sources.CurrentService import CurrentService
 
 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)
 class PVRState(Screen):
        def __init__(self, session):
                Screen.__init__(self, session)
index 7c4c3ec..045e8fb 100644 (file)
@@ -9,12 +9,10 @@ from Screens.ChoiceBox import ChoiceBox
 from Screens.MessageBox import MessageBox
 from Screens.InputBox import InputBox, Input, PinInput
 from Screens.ChannelSelection import service_types_tv
 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
 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):
 
 class ProtectedScreen:
        def __init__(self):
@@ -192,7 +190,7 @@ class ParentalControlEditor(Screen):
                        else:
                                x = (x, x)
                        mylist.append(x)
                        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)
 
                sel = ord(self.currentLetter) - SPECIAL_CHAR
                self.session.openWithCallback(self.letterChosen, ChoiceBox, title=_("Show services beginning with"), list=mylist, keys = [], selection = sel)
 
index af31393..67c5b84 100644 (file)
@@ -1,14 +1,10 @@
-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 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
 
 from Components.ChoiceList import ChoiceEntryComponent, ChoiceList
 
-import os
-
 # this is not so great.
 MAX_X = 720
 MAX_Y = 576
 # this is not so great.
 MAX_X = 720
 MAX_Y = 576
index 329300a..dc51144 100644 (file)
@@ -1,10 +1,7 @@
 from Screen import Screen
 from MessageBox import MessageBox
 from Screen import Screen
 from MessageBox import MessageBox
-
 from Components.AVSwitch import AVSwitch
 
 from Components.AVSwitch import AVSwitch
 
-from enigma import *
-
 class Scart(Screen):
        def __init__(self, session, start_visible=True):
                Screen.__init__(self, session)
 class Scart(Screen):
        def __init__(self, session, start_visible=True):
                Screen.__init__(self, session)
index 9e3ade4..064171f 100644 (file)
@@ -2,7 +2,7 @@ from Screen import Screen
 from Components.ActionMap import ActionMap
 from Components.config import config
 from Components.AVSwitch import AVSwitch
 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):
 
 class Standby(Screen):
        def Power(self):
diff --git a/lib/python/enigma_py_patcher.py b/lib/python/enigma_py_patcher.py
new file mode 100644 (file)
index 0000000..52f9d23
--- /dev/null
@@ -0,0 +1,43 @@
+#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")
index 9248473..090585b 100644 (file)
@@ -91,7 +91,6 @@ is usually caused by not marking PSignals as immutable.
 #include <lib/gdi/lcd.h>
 #include <lib/dvb_ci/dvbci_ui.h>
 #include <lib/python/python.h>
 #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/gdi/picload.h>
 
 extern void runMainloop();
@@ -153,8 +152,6 @@ typedef long time_t;
 %include <lib/base/smartptr.h>
 %include <lib/service/iservice.h>
 %include <lib/service/service.h>
 %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/service/event.h>
 
 // TODO: embed these...
@@ -222,12 +219,9 @@ typedef long time_t;
 %include <lib/dvb_ci/dvbci_ui.h>
 %include <lib/dvb/db.h>
 %include <lib/python/python.h>
 %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  **************/
 
 %include <lib/gdi/picload.h>
 /**************  eptr  **************/
 
-%template(eActionMapPtr) ePtr<eActionMap>;
-
 /**************  signals  **************/
 
 template<class R> class PSignal0
 /**************  signals  **************/
 
 template<class R> class PSignal0
index d0fe92a..76d2d19 100644 (file)
@@ -157,7 +157,7 @@ public:
        TestObj();
        ~TestObj();
 };
        TestObj();
        ~TestObj();
 };
-TEMPLATE_TYPEDEF(ePtr<TestObj>, TestObjPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<TestObj>, TestObjPtr);
 
 #ifndef SWIG
 extern PyObject *New_TestObj();
 
 #ifndef SWIG
 extern PyObject *New_TestObj();
index c094b64..da787ee 100644 (file)
@@ -2,29 +2,27 @@
 #define __lib_python_swig_h
 
 #ifdef SWIG
 #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_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
 #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
index 25b9d0b..d1e1d08 100644 (file)
@@ -3,13 +3,15 @@
 
 #ifndef SWIG
 #include <time.h>
 
 #ifndef SWIG
 #include <time.h>
-#include <lib/base/object.h>
-#include <lib/service/iservice.h>
 #include <list>
 #include <string>
 class Event;
 #endif
 
 #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);
 struct eComponentData
 {
 DECLARE_REF(eComponentData);
@@ -26,9 +28,9 @@ DECLARE_REF(eComponentData);
        std::string getIso639LanguageCode(void) const { return m_iso639LanguageCode; }
        std::string getText(void) const { return m_text; }
 };
        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);
 class eServiceEvent: public iObject
 {
        DECLARE_REF(eServiceEvent);
@@ -58,10 +60,10 @@ public:
        int getNumOfLinkageServices() const { return m_linkage_services.size(); }
        SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, eServiceReference &parent, int num) const;
 };
        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
 #ifndef SWIG
-
+SWIG_IGNORE(eDebugClass);
 class eDebugClass: public iObject
 {
        DECLARE_REF(eDebugClass);
 class eDebugClass: public iObject
 {
        DECLARE_REF(eDebugClass);
@@ -71,8 +73,7 @@ public:
        eDebugClass(int i) { printf("build debug class %d\n", i); x = i; }
        ~eDebugClass() { printf("remove debug class %d\n", x); }
 };
        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
 #endif
 
 #endif
index c809e81..98ece76 100644 (file)
@@ -224,8 +224,9 @@ typedef long long pts_t;
           
           Hide the result only if there is another way to check for failure! */
           
           
           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
 class iStaticServiceInformation: public iObject
 {
 #ifdef SWIG
@@ -234,7 +235,7 @@ class iStaticServiceInformation: public iObject
 #endif
 public:
        virtual SWIG_VOID(RESULT) getName(const eServiceReference &ref, std::string &SWIG_OUTPUT)=0;
 #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);
                // 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);
@@ -244,52 +245,46 @@ public:
        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 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);
 };
        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
 {
 #ifdef SWIG
-       iServiceInformation();
-       ~iServiceInformation();
+       iServiceInformation_ENUMS();
+       ~iServiceInformation_ENUMS();
 #endif
 public:
 #endif
 public:
-       virtual SWIG_VOID(RESULT) getName(std::string &SWIG_OUTPUT)=0;
-       virtual SWIG_VOID(RESULT) getEvent(ePtr<eServiceEvent> &SWIG_OUTPUT, int nownext);
-
        enum {
        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!
                        /* "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
                           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,
                sVideoPID,
                sAudioPID,
                sPCRPID,
                sPMTPID,
                sTXTPID,
-               
+
                sSID,
                sONID,
                sTSID,
                sNamespace,
                sProvider,
                sSID,
                sONID,
                sTSID,
                sNamespace,
                sProvider,
-               
+
                sDescription,
                sServiceref,
                sDescription,
                sServiceref,
-               sTimeCreate,    // unix time or string
-               
+               sTimeCreate,            /* unix time or string */
+
                sTitle,
                sArtist,
                sAlbum,
                sTitle,
                sArtist,
                sAlbum,
@@ -297,34 +292,60 @@ public:
                sTracknumber,
                sGenre,
                sCAIDs,
                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,
 
                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 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);
 };
        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
 {
 #ifdef SWIG
-       iFrontendInformation();
-       ~iFrontendInformation();
+       iFrontendInformation_ENUMS();
+       ~iFrontendInformation_ENUMS();
 #endif
 public:
        enum {
 #endif
 public:
        enum {
@@ -335,12 +356,22 @@ public:
                syncState,
                frontendNumber
        };
                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;
 };
        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
 class iPauseableService: public iObject
 {
 #ifdef SWIG
@@ -350,15 +381,25 @@ class iPauseableService: public iObject
 public:
        virtual RESULT pause()=0;
        virtual RESULT unpause()=0;
 public:
        virtual RESULT pause()=0;
        virtual RESULT unpause()=0;
-       
+
                /* hm. */
        virtual RESULT setSlowMotion(int ratio=0)=0;
        virtual RESULT setFastForward(int ratio=0)=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();
 {
 #ifdef SWIG
        iSeekableService();
@@ -367,16 +408,14 @@ class iSeekableService: public iObject
 public:
        virtual RESULT getLength(pts_t &SWIG_OUTPUT)=0;
        virtual RESULT seekTo(pts_t to)=0;
 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;
        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;
 };
                   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
 {
 
 struct iAudioTrackInfo
 {
@@ -387,9 +426,9 @@ struct iAudioTrackInfo
        std::string getDescription() { return m_description; }
        std::string getLanguage() { return m_language; }
 };
        std::string getDescription() { return m_description; }
        std::string getLanguage() { return m_language; }
 };
-
 SWIG_ALLOW_OUTPUT_SIMPLE(iAudioTrackInfo);
 
 SWIG_ALLOW_OUTPUT_SIMPLE(iAudioTrackInfo);
 
+SWIG_IGNORE(iAudioTrackSelection);
 class iAudioTrackSelection: public iObject
 {
 #ifdef SWIG
 class iAudioTrackSelection: public iObject
 {
 #ifdef SWIG
@@ -401,23 +440,32 @@ public:
        virtual RESULT selectTrack(unsigned int i)=0;
        virtual SWIG_VOID(RESULT) getTrackInfo(struct iAudioTrackInfo &SWIG_OUTPUT, unsigned int n)=0;
 };
        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:
 {
 #ifdef SWIG
        iAudioChannelSelection();
        ~iAudioChannelSelection();
 #endif
 public:
-       enum { LEFT, STEREO, RIGHT };
        virtual int getCurrentChannel()=0;
        virtual RESULT selectChannel(int i)=0;
 };
        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
 class iAudioDelay: public iObject
 {
 #ifdef SWIG
@@ -430,9 +478,9 @@ public:
        virtual void setAC3Delay(int)=0;
        virtual void setPCMDelay(int)=0;
 };
        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
 class iRadioText: public iObject
 {
 #ifdef SWIG
@@ -442,9 +490,9 @@ class iRadioText: public iObject
 public:
        virtual std::string getRadioText(int x=0)=0;
 };
 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
 class iSubserviceList: public iObject
 {
 #ifdef SWIG
@@ -455,9 +503,9 @@ public:
        virtual int getNumberOfSubservices()=0;
        virtual SWIG_VOID(RESULT) getSubservice(eServiceReference &SWIG_OUTPUT, unsigned int n)=0;
 };
        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
 class iTimeshiftService: public iObject
 {
 #ifdef SWIG
@@ -467,34 +515,44 @@ class iTimeshiftService: public iObject
 public:
        virtual RESULT startTimeshift()=0;
        virtual RESULT stopTimeshift()=0;
 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;
 };
        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 */
 
        /* 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:
 {
 #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;
        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;
 
 
 class eWidget;
 class PyList;
 
+SWIG_IGNORE(iSubtitleOutput);
 class iSubtitleOutput: public iObject
 {
 public:
 class iSubtitleOutput: public iObject
 {
 public:
@@ -503,42 +561,134 @@ public:
        virtual PyObject *getSubtitleList()=0;
        virtual PyObject *getCachedSubtitle()=0;
 };
        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
 {
 #ifdef SWIG
-       iPlayableService();
-       ~iPlaybleService();
+       iListableService();
+       ~iListableService();
 #endif
 #endif
-       friend class iServiceHandler;
 public:
 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,
                        /* these first two events are magical, and should only
                           be generated if you know what you're doing. */
                evStart,
                evEnd,
-               
+
                evTuneFailed,
                evTuneFailed,
-                       // when iServiceInformation is implemented:
+
+                       /* when iServiceInformation is implemented:*/
                evUpdatedEventInfo,
                evUpdatedInfo,
 
                evUpdatedEventInfo,
                evUpdatedInfo,
 
-                       /* when seek() is implemented: */               
+                       /* when seek() is implemented: */
                evSeekableStatusChanged, /* for example when timeshifting */
                evSeekableStatusChanged, /* for example when timeshifting */
-               
+
                evEOF,
                evSOF, /* bounced against start of file (when seeking backwards) */
                evEOF,
                evSOF, /* bounced against start of file (when seeking backwards) */
-               
-                       /* only when cueSheet is implemented */
+
+                       /* when cueSheet is implemented */
                evCuesheetChanged,
 
                evCuesheetChanged,
 
+                       /* when radioText is implemented */
                evUpdatedRadioText,
 
                evVideoSizeChanged
        };
                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
 #ifndef SWIG
        virtual RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)=0;
 #endif
@@ -559,18 +709,16 @@ public:
        virtual SWIG_VOID(RESULT) audioDelay(ePtr<iAudioDelay> &SWIG_OUTPUT)=0;
        virtual SWIG_VOID(RESULT) radioText(ePtr<iRadioText> &SWIG_OUTPUT)=0;
 };
        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
 {
 #ifdef SWIG
-       iRecordableService();
-       ~iRecordableService();
+       iRecordableService_ENUMS();
+       ~iRecordableService_ENUMS();
 #endif
 public:
 #endif
 public:
-       enum
-       {
+       enum {
                evStart,
                evStop,
                evTunedIn,
                evStart,
                evStop,
                evTunedIn,
@@ -579,10 +727,9 @@ public:
                evRecordStopped,
                evNewProgramInfo,
                evRecordFailed
                evRecordStopped,
                evNewProgramInfo,
                evRecordFailed
-//             evDiskFull
+               /*evDiskFull*/
        };
        };
-       enum
-       {
+       enum {
                NoError=0,
                errOpenRecordFile=-1,
                errNoDemuxAvailable=-2,
                NoError=0,
                errOpenRecordFile=-1,
                errNoDemuxAvailable=-2,
@@ -590,6 +737,16 @@ public:
                errDiskFull=-4,
                errTuneFailed=-255
        };
                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
 #ifndef SWIG
        virtual RESULT connectEvent(const Slot2<void,iRecordableService*,int> &event, ePtr<eConnection> &connection)=0;
 #endif
@@ -599,8 +756,7 @@ public:
        virtual RESULT stop()=0;
        virtual SWIG_VOID(RESULT) frontendInfo(ePtr<iFrontendInformation> &SWIG_OUTPUT)=0;
 };
        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
 
 
 extern PyObject *New_iRecordableServicePtr(const ePtr<iRecordableService> &ref); // defined in enigma_python.i
 
@@ -625,90 +781,7 @@ inline ePyObject Impl_New_iRecordableServicePtr(const ePtr<iRecordableService> &
 #endif
 #endif // SWIG
 
 #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
 class iServiceHandler: public iObject
 {
 #ifdef SWIG
@@ -722,7 +795,6 @@ public:
        virtual SWIG_VOID(RESULT) info(const eServiceReference &, ePtr<iStaticServiceInformation> &SWIG_OUTPUT)=0;
        virtual SWIG_VOID(RESULT) offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &SWIG_OUTPUT)=0;
 };
        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
 
 #endif
index 813da24..77173c5 100644 (file)
@@ -7,13 +7,15 @@
 
 class eServiceCenter;
 
 
 class eServiceCenter;
 
+#ifndef SWIG
 typedef ePtr<eServiceCenter> eServiceCenterPtr;
 typedef ePtr<eServiceCenter> eServiceCenterPtr;
+#endif
 
 class eServiceCenter: public iServiceHandler
 {
 DECLARE_REF(eServiceCenter);
 private:
 
 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();
        static eServiceCenter *instance;
 #ifdef SWIG
        eServiceCenter();
@@ -23,19 +25,20 @@ public:
 #ifndef SWIG
        eServiceCenter();
        virtual ~eServiceCenter();
 #ifndef SWIG
        eServiceCenter();
        virtual ~eServiceCenter();
-#endif
+
                // iServiceHandler
                // 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
        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);
        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
 };
 
 #endif
index 9587273..2b032e6 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -1,5 +1,6 @@
 from Tools import RedirectOutput
 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
 from tools import *
 
 from Components.Language import language
@@ -10,12 +11,11 @@ def setEPGLanguage():
        
 language.addCallback(setEPGLanguage)
 
        
 language.addCallback(setEPGLanguage)
 
-import traceback
+from traceback import print_exc
 import Screens.InfoBar
 from Screens.SimpleSummary import SimpleSummary
 
 import Screens.InfoBar
 from Screens.SimpleSummary import SimpleSummary
 
-import sys
-import time
+from sys import stdout, exc_info
 
 import ServiceReference
 
 
 import ServiceReference
 
@@ -27,7 +27,7 @@ from Navigation import Navigation
 from skin import readSkin, applyAllAttributes
 
 from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE
 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()
 
 InitFallbackFiles()
 eDVBDB.getInstance().reloadBouquets()
 
@@ -191,9 +191,9 @@ class Session:
                try:
                        return screen(self, *arguments, **kwargs)
                except:
                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
                        print errstr
-                       traceback.print_exc(file=sys.stdout)
+                       print_exc(file=stdout)
                        quitMainloop(5)
        
        def instantiateDialog(self, screen, *arguments, **kwargs):
                        quitMainloop(5)
        
        def instantiateDialog(self, screen, *arguments, **kwargs):
@@ -214,7 +214,7 @@ class Session:
                except:
                        print 'EXCEPTION IN DIALOG INIT CODE, ABORTING:'
                        print '-'*60
                except:
                        print 'EXCEPTION IN DIALOG INIT CODE, ABORTING:'
                        print '-'*60
-                       traceback.print_exc(file=sys.stdout)
+                       print_exc(file=stdout)
                        quitMainloop(5)
                        print '-'*60
                
                        quitMainloop(5)
                        print '-'*60
                
@@ -493,9 +493,9 @@ def runScreenTest():
        runReactor()
        
        configfile.save()
        runReactor()
        
        configfile.save()
-       
-       from Tools.DreamboxHardware import setFPWakeuptime
+
        from time import time
        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
        nextRecordingTime = session.nav.RecordTimer.getNextRecordingTime()
        if nextRecordingTime != -1:
                if (nextRecordingTime - time() < 330): # no time to switch box back on
@@ -553,6 +553,6 @@ try:
 except:
        print 'EXCEPTION IN PYTHON STARTUP CODE:'
        print '-'*60
 except:
        print 'EXCEPTION IN PYTHON STARTUP CODE:'
        print '-'*60
-       traceback.print_exc(file=sys.stdout)
+       print_exc(file=stdout)
        quitMainloop(5)
        print '-'*60
        quitMainloop(5)
        print '-'*60
diff --git a/skin.py b/skin.py
index 52b5536..b2daa7f 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -1,13 +1,15 @@
-from enigma import *
 import xml.dom.minidom
 from xml.dom import EMPTY_NAMESPACE
 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 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()
 from Tools.XMLTools import elementsWithTag, mergeText
 
 colorNames = dict()
@@ -20,8 +22,6 @@ def dump(x, i=0):
        except:
                None
 
        except:
                None
 
-from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS
-
 class SkinError(Exception):
        def __init__(self, message):
                self.message = message
 class SkinError(Exception):
        def __init__(self, message):
                self.message = message
@@ -34,8 +34,8 @@ dom_skins = [ ]
 def loadSkin(name):
        # read the skin
        filename = resolveFilename(SCOPE_SKIN, name)
 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
 
 # we do our best to always select the "right" value
 # skins are loaded in order of priority: skin with
@@ -262,8 +262,7 @@ def loadSingleSkinData(desktop, dom_skin, path_prefix):
                        except:
                                raise ("Unknown color %s" % (type))
                        
                        except:
                                raise ("Unknown color %s" % (type))
                        
-               x = eWindowStyleManagerPtr()
-               eWindowStyleManager.getInstance(x)
+               x = eWindowStyleManager.getInstance()
                x.setStyle(id, style)
 
 def loadSkinData(desktop):
                x.setStyle(id, style)
 
 def loadSkinData(desktop):
index e298f66..5720cf9 100644 (file)
--- a/timer.py
+++ b/timer.py
@@ -1,7 +1,7 @@
-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
 
 class TimerEntry:
        StateWaiting  = 0
@@ -33,15 +33,15 @@ class TimerEntry:
        def processRepeated(self):
                print "ProcessRepeated"
                if (self.repeated != 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
 
                        #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 = []
                        flags = self.repeated
@@ -53,21 +53,21 @@ class TimerEntry:
                                        day.append(1)
                                flags = flags >> 1
 
                                        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)):
                        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
                                #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
 
                        #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 "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()
 
 
                        self.timeChanged()
 
@@ -84,10 +84,10 @@ class TimerEntry:
 
        # check if a timer entry must be skipped
        def shouldSkip(self):
 
        # 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):
 
        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.
                
                # in case timer has not yet started, but gets aborted (so it's preparing),
                # set begin to now.
@@ -124,7 +124,7 @@ class Timer:
                
                self.timer = eTimer()
                self.timer.timeout.get().append(self.calcNextActivation)
                
                self.timer = eTimer()
                self.timer.timeout.get().append(self.calcNextActivation)
-               self.lastActivation = time.time()
+               self.lastActivation = time()
                
                self.calcNextActivation()
                self.on_state_change = [ ]
                
                self.calcNextActivation()
                self.on_state_change = [ ]
@@ -152,22 +152,22 @@ class Timer:
                        print "shouldSkip:", entry.shouldSkip()
                        print "state == ended", entry.state == TimerEntry.StateEnded
                        print "waiting && disabled:", (entry.state == TimerEntry.StateWaiting and entry.disabled)
                        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:
                        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):
                        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):
                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 = [ ]
                        print "[timer.py] timewarp - re-evaluating all processed timers."
                        tl = self.processed_timers
                        self.processed_timers = [ ]
@@ -177,9 +177,9 @@ class Timer:
                                self.addTimerEntry(x, noRecalc=1)
                
                self.processActivation()
                                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):
                
                # calculate next activation point
                if len(self.timer_list):
@@ -219,7 +219,7 @@ class Timer:
                # did this timer reached the last state?
                if w.state < TimerEntry.StateEnded:
                        # no, sort it into active 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:
                else:
                        # yes. Process repeated, and re-add.
                        if w.repeated:
@@ -227,13 +227,13 @@ class Timer:
                                w.state = TimerEntry.StateWaiting
                                self.addTimerEntry(w)
                        else:
                                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):
                
                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:
                
                # 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: