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 50cdf01f3b00e3024dff1efa0f5385ff3150c2f2..c2d2752a1a4b9cc1e1b9de95f7610de925d9b51b 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
index 9dd316f245cd1a576848eec205dca96ecaa3231f..f7aa6397a4290a6333d79b2521afe395cfa813c8 100644 (file)
@@ -1,5 +1,4 @@
-
-from enigma import *
+from enigma import eServiceReference, eServiceCenter
 
 import NavigationInstance
 
index 1a6a378136500d7d6852be9bca8cccf3a78c6fde..f8aa07f49f4892f352eb7eb6f5c7f363e0ff242a 100644 (file)
@@ -9,8 +9,7 @@ from Tools.KeyBindings import addKeyBinding
 
 def readKeymap():
 
-       p = enigma.eActionMapPtr()
-       enigma.eActionMap.getInstance(p)
+       p = enigma.eActionMap.getInstance()
        assert p
        
        filename1 = "data/keymap.xml"
index 56ad89a11dff572449d57b2f694174a32f8bd9f5..c1d2c19151b0b21959edb7a5fc19052a0593a65e 100644 (file)
@@ -41,13 +41,6 @@ RESULT eActionMap::getInstance(ePtr<eActionMap> &ptr)
        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;
@@ -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");
index f2e0d8f460d5730374f7fcdde3613c7e32f66900..7bd71259eb7ec486d058bf1227c0dc6679bfe201 100644 (file)
@@ -13,6 +13,7 @@
 
 class eWidget;
 
+SWIG_IGNORE(eActionMap);
 class eActionMap: public iObject
 {
 DECLARE_REF(eActionMap);
@@ -35,8 +36,8 @@ public:
        
        void keyPressed(const std::string &device, int key, int flags);
        
-       static RESULT getInstance(ePtr<eActionMap> &ptr);
 #ifndef SWIG
+       static RESULT getInstance(ePtr<eActionMap> &);
 private:
        static eActionMap *instance;
        struct eActionBinding
@@ -78,5 +79,13 @@ private:
        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
index db936794df3425f403b05d07f727fb6255a1da93..75b582056622d55d9182dc106ab5f7fe4d3577d0 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __ebase_h
 #define __ebase_h
 
+#ifndef SWIG
 #include <vector>
 #include <map>
 #include <sys/poll.h>
@@ -9,8 +10,10 @@
 #include <time.h>
 
 #include <lib/base/eptrlist.h>
-#include <lib/python/connections.h>
 #include <libsig_comp.h>
+#endif
+
+#include <lib/python/connections.h>
 
 class eApplication;
 
index 4accdba8d1c9cf56341ebb16ad2b5d1def2e48c0..25879ce0ab314d9eb158dfad29c6f41453a8cb20 100644 (file)
@@ -1,8 +1,7 @@
 #include "etimezone.h"
-
 #include <time.h>
 
-etimezone::etimezone()
+void e_tzset()
 {
        tzset();
 }
index 081bf1393223be8de3172417b8900222651ccb17..7f1b2a80502e609a9f22641460b41e764006aa3d 100644 (file)
@@ -1,11 +1,7 @@
 #ifndef __etimezone_h
 #define __etimezone_h
 
-class etimezone
-{
-public:
-       etimezone();
-};
+void e_tzset(void);
 
 #endif
 
index 430a5af0b48b692dd837458a43c2373886f28ad1..34ecfc1458bc8064480f1062a87f099a0eee5c91 100644 (file)
@@ -2,8 +2,8 @@
 #define __db_h
 
 #ifndef SWIG
-#include <lib/base/eptrlist.h>
 #include <lib/dvb/idvb.h>
+#include <lib/base/eptrlist.h>
 #include <set>
 class ServiceDescriptionSection;
 #endif
index ecb0ec6ed1724d70e9969e1af91aba12b0067526..ad146542412c6e76ada44de6f5fdbec7f7609034 100644 (file)
@@ -52,6 +52,13 @@ RESULT eDVBResourceManager::getInstance(ePtr<eDVBResourceManager> &ptr)
        return -1;
 }
 
+ePtr<eDVBResourceManager> NewResourceManagerPtr(void)
+{
+       ePtr<eDVBResourceManager> ptr;
+       eDVBResourceManager::getInstance(ptr);
+       return ptr;
+}
+
 eDVBResourceManager::eDVBResourceManager()
        :m_releaseCachedChannelTimer(eApp)
 {
index 037c1974d2e91970bd85b06db630c6c8964d4e09..95d10916f5a06366321d9bafd9eff92117b6ccbf 100644 (file)
@@ -125,9 +125,9 @@ private:
        eSmartPtrList<eDVBFrontend> m_frontend;
        eSmartPtrList<eDVBDemux>    m_demux;
 };
-
 #endif // SWIG
 
+SWIG_IGNORE(eDVBResourceManager);
 class eDVBResourceManager: public iObject, public Object
 {
        DECLARE_REF(eDVBResourceManager);
@@ -197,23 +197,30 @@ public:
                errNoDemux    = -2,
                errChidNotFound = -3
        };
-
+       
        RESULT connectChannelAdded(const Slot1<void,eDVBChannel*> &channelAdded, ePtr<eConnection> &connection);
        int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore);
 
                /* allocate channel... */
        RESULT allocateChannel(const eDVBChannelID &channelid, eUsePtr<iDVBChannel> &channel);
        RESULT allocatePVRChannel(eUsePtr<iDVBPVRChannel> &channel);
+       static SWIG_VOID(RESULT) getInstance(ePtr<eDVBResourceManager> &SWIG_OUTPUT);
 #ifdef SWIG
 public:
 #endif
        PSignal1<void,int> frontendUseMaskChanged;
-       RESULT allocateRawChannel(eUsePtr<iDVBChannel> &, int frontend_index);
-       static RESULT getInstance(ePtr<eDVBResourceManager> &);
+       SWIG_VOID(RESULT) allocateRawChannel(eUsePtr<iDVBChannel> &SWIG_OUTPUT, int frontend_index);
 };
-TEMPLATE_TYPEDEF(ePtr<eDVBResourceManager>, eDVBResourceManagerPtr);
-#ifndef SWIG
+SWIG_TEMPLATE_TYPEDEF_REPLACE(ePtr<eDVBResourceManager>, eDVBResourceManager);
+SWIG_EXTEND(ePtr<eDVBResourceManager>,
+       static ePtr<eDVBResourceManager> getInstance()
+       {
+               extern ePtr<eDVBResourceManager> NewResourceManagerPtr(void);
+               return NewResourceManagerPtr();
+       }
+);
 
+#ifndef SWIG
        /* iDVBPVRChannel includes iDVBChannel. don't panic. */
 class eDVBChannel: public iDVBPVRChannel, public iFilePushScatterGather, public Object
 {
@@ -289,6 +296,6 @@ private:
        void AddUse();
        void ReleaseUse();
 };
-
 #endif // SWIG
+
 #endif
index 9e78153bc1c57533212d2cacdbffaecfb77efb9d..a34be984fa69bf74972b4a49ca8166914ff884fb 100644 (file)
@@ -391,32 +391,31 @@ public:
 class iDVBSatelliteEquipmentControl;
 class eSecCommandList;
 
-class iDVBFrontend: public iObject
+class iDVBFrontend_ENUMS
+{
+#ifdef SWIG
+       iDVBFrontend_ENUMS();
+       ~iDVBFrontend_ENUMS();
+#endif
+public:
+       enum { feSatellite, feCable, feTerrestrial };
+       enum { stateIdle, stateTuning, stateFailed, stateLock, stateLostLock };
+       enum { toneOff, toneOn };
+       enum { voltageOff, voltage13, voltage18, voltage13_5, voltage18_5 };
+       enum { bitErrorRate, signalPower, signalQuality, locked, synced, frontendNumber };
+};
+
+SWIG_IGNORE(iDVBFrontend);
+class iDVBFrontend: public iDVBFrontend_ENUMS, public iObject
 {
 public:
-       enum {
-               feSatellite, feCable, feTerrestrial
-       };
        virtual RESULT getFrontendType(int &SWIG_OUTPUT)=0;
        virtual RESULT tune(const iDVBFrontendParameters &where)=0;
 #ifndef SWIG
        virtual RESULT connectStateChange(const Slot1<void,iDVBFrontend*> &stateChange, ePtr<eConnection> &connection)=0;
 #endif
-       enum {
-               stateIdle = 0,
-               stateTuning = 1,
-               stateFailed = 2,
-               stateLock = 3,
-               stateLostLock = 4,
-       };
        virtual RESULT getState(int &SWIG_OUTPUT)=0;
-       enum {
-               toneOff, toneOn
-       };
        virtual RESULT setTone(int tone)=0;
-       enum {
-               voltageOff, voltage13, voltage18, voltage13_5, voltage18_5
-       };
        virtual RESULT setVoltage(int voltage)=0;
        virtual RESULT sendDiseqc(const eDVBDiseqcCommand &diseqc)=0;
        virtual RESULT sendToneburst(int burst)=0;
@@ -424,12 +423,8 @@ public:
        virtual RESULT setSEC(iDVBSatelliteEquipmentControl *sec)=0;
        virtual RESULT setSecSequence(const eSecCommandList &list)=0;
 #endif
-       enum {
-               bitErrorRate, signalPower, signalQuality, locked, synced, frontendNumber
-       };
        virtual int readFrontendData(int type)=0;
        virtual PyObject *readTransponderData(bool original)=0;
-
 #ifndef SWIG
        virtual RESULT getData(int num, int &data)=0;
        virtual RESULT setData(int num, int val)=0;
@@ -437,7 +432,7 @@ public:
        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
@@ -454,9 +449,13 @@ struct eDVBCIRouting
 };
 #endif // SWIG
 
+SWIG_IGNORE(iDVBChannel);
 class iDVBChannel: public iObject
 {
 public:
+               /* direct frontend access for raw channels and/or status inquiries. */
+       virtual SWIG_VOID(RESULT) getFrontend(ePtr<iDVBFrontend> &SWIG_OUTPUT)=0;
+#ifndef SWIG
        enum
        {
                state_idle,        /* not yet tuned */
@@ -467,12 +466,8 @@ public:
                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 
        {
@@ -495,10 +490,9 @@ public:
        virtual void ReleaseUse() = 0;
 #endif
 };
-TEMPLATE_TYPEDEF(eUsePtr<iDVBChannel>, iDVBChannelPtr);
+SWIG_TEMPLATE_TYPEDEF(eUsePtr<iDVBChannel>, iDVBChannelPtr);
 
 #ifndef SWIG
-
        /* signed, so we can express deltas. */
        
 typedef long long pts_t;
index d717ec6ff5d39c01d1c22b14f0a24c2673d942a5..e3798bf72fd27ef9d1b940eea88aa422b6067105 100644 (file)
@@ -107,17 +107,18 @@ struct gSurface
 
 class gRegion;
 
+SWIG_IGNORE(gPixmap);
 class gPixmap: public iObject
 {
        DECLARE_REF(gPixmap);
 public:
+#ifndef SWIG
        enum
        {
                blitAlphaTest=1,
                blitAlphaBlend=2
        };
 
-#ifndef SWIG
        gPixmap(gSurface *surface);
        gPixmap(eSize, int bpp, int accel = 0);
 
@@ -128,14 +129,12 @@ public:
        
        gPixmap *lock();
        void unlock();
+       inline bool needClut() const { return surface && surface->bpp <= 8; }
 #endif
        virtual ~gPixmap();
-       
        eSize size() const { return eSize(surface->x, surface->y); }
-       inline bool needClut() const { return surface && surface->bpp <= 8; }
 private:
        bool must_delete_surface;
-#ifndef SWIG
        friend class gDC;
        void fill(const gRegion &clip, const gColor &color);
        void fill(const gRegion &clip, const gRGB &color);
@@ -144,12 +143,10 @@ private:
        
        void mergePalette(const gPixmap &target);
        void line(const gRegion &clip, ePoint start, ePoint end, gColor color);
-#else
+#ifdef SWIG
        gPixmap();
 #endif
-
 };
-
-TEMPLATE_TYPEDEF(ePtr<gPixmap>, gPixmapPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<gPixmap>, gPixmapPtr);
 
 #endif
index d86d592d795d3905ebc512b5e7fbbd5f048fd491..9c89c65863295e74a9b778f4769da1e8d06132dc 100644 (file)
@@ -72,4 +72,15 @@ private:
        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
index f7c611f6c144918e142e603e0577b9f5e069237d..98b30087af32e545dd73d249b502fc80c4d61311 100644 (file)
@@ -34,7 +34,7 @@ public:
        
        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);
index 2558669ae363ae98ff33aec5711b809501d5bde1..68a74e0c836bf551d5380e9a49a9262bc6436610 100644 (file)
@@ -9,6 +9,13 @@ eWindowStyle::~eWindowStyle() {}
 
 DEFINE_REF(eWindowStyleManager);
 
+ePtr<eWindowStyleManager> NewWindowStylePtr(void)
+{
+       ePtr<eWindowStyleManager> ptr;
+       eWindowStyleManager::getInstance(ptr);
+       return ptr;
+}
+
 eWindowStyleManager::eWindowStyleManager()
 {
        m_instance = this;
index 4824aad62c44a2f8bcdd9ffa5d619ac428e785cd..91f2f0b7414b143d35d00d3ce362bb60dc8afb9a 100644 (file)
@@ -7,13 +7,22 @@ class gFont;
 
 #include <lib/base/object.h>
 
+SWIG_IGNORE(eWindowStyle);
 class eWindowStyle: public iObject
 {
+#ifdef SWIG
+       eWindowStyle();
+#endif
 public:
+#ifndef SWIG
        virtual void handleNewSize(eWindow *wnd, eSize &size, eSize &offset) = 0;
        virtual void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) = 0;
        virtual void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) = 0;
        virtual void setStyle(gPainter &painter, int what) = 0;
+       virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
+       virtual RESULT getFont(int what, ePtr<gFont> &font) = 0;
+#endif
+       virtual ~eWindowStyle() = 0;
        enum {
                styleLabel,
                styleListboxSelected,
@@ -22,8 +31,6 @@ public:
                styleListboxMarkedAndSelected
        };
        
-       virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
-       
        enum {
                frameButton,
                frameListboxEntry
@@ -34,11 +41,10 @@ public:
                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);
@@ -51,16 +57,23 @@ public:
        eWindowStyleManager();
        ~eWindowStyleManager();
 #endif
-       void getStyle(int style_id, ePtr<eWindowStyle> &style);
+       void getStyle(int style_id, ePtr<eWindowStyle> &SWIG_OUTPUT);
        void setStyle(int style_id, eWindowStyle *style);
-       static int getInstance(ePtr<eWindowStyleManager> &mgr) { mgr = m_instance; if (!mgr) return -1; return 0; }
+       static SWIG_VOID(int) getInstance(ePtr<eWindowStyleManager> &SWIG_NAMED_OUTPUT(mgr)) { mgr = m_instance; if (!mgr) return -1; return 0; }
 private:
        static eWindowStyleManager *m_instance;
        std::map<int, ePtr<eWindowStyle> > m_current_style;
 };
+SWIG_TEMPLATE_TYPEDEF_REPLACE(ePtr<eWindowStyleManager>, eWindowStyleManager);
+SWIG_EXTEND(ePtr<eWindowStyleManager>,
+       static ePtr<eWindowStyleManager> getInstance()
+       {
+               extern ePtr<eWindowStyleManager> NewWindowStylePtr(void);
+               return NewWindowStylePtr();
+       }
+);
 
-TEMPLATE_TYPEDEF(ePtr<eWindowStyleManager>, eWindowStyleManagerPtr);
-
+#ifndef SWIG
 class eWindowStyleSimple: public eWindowStyle
 {
        DECLARE_REF(eWindowStyleSimple);
@@ -78,5 +91,6 @@ public:
        void drawFrame(gPainter &painter, const eRect &frame, int what);
        RESULT getFont(int what, ePtr<gFont> &font);
 };
+#endif
 
 #endif
index 1c16a7b516ca22241d3f139e6441ae7fa0641c7a..57c54a08ff704e5e8032faff22729a69bb673c21 100644 (file)
@@ -8,12 +8,14 @@ class eWindowStyleSkinned: public eWindowStyle
        DECLARE_REF(eWindowStyleSkinned);
 public:
        eWindowStyleSkinned();
+#ifndef SWIG
        void handleNewSize(eWindow *wnd, eSize &size, eSize &offset);
        void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title);
        void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size);
-       void setStyle(gPainter &painter, int what);
        void drawFrame(gPainter &painter, const eRect &frame, int what);
        RESULT getFont(int what, ePtr<gFont> &font);
+#endif
+       void setStyle(gPainter &painter, int what);
        
        enum {
                bsWindow,
index 8a7bd8d1e3e6b69f3e27a501c0e7bbef95f577c8..a8e471ba645e2322a3802ef35d4aac8468a62c0a 100644 (file)
@@ -1,6 +1,6 @@
 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) }
index e5f9543edce4d8945ace967ef0ca5cc647531e64..2f3fec092fd64d3d4fd494df8abc27503316f2f3 100644 (file)
@@ -1,4 +1,4 @@
-from Tools.Directories import *
+from Tools.Directories import resolveFilename, SCOPE_SYSETC
 
 class About:
        def __init__(self):
index d2e908e610fe1bc2a0e805db182d404b0c412206..b65d6ebc218ec7f9ced446da62f5d3ed06973c8e 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
-               self.p = eActionMapPtr()
+               self.p = eActionMap.getInstance()
                self.bound = False
                self.exec_active = False
                self.enabled = True
-               eActionMap.getInstance(self.p)
-       
+
        def setEnabled(self, enabled):
                self.enabled = enabled
                self.checkBind()
index a0fbde542ac5f44263c1680c515c278a8a4e8bce..a2070c7db6a2ae74332fe7e5946976e5397b93d9 100644 (file)
@@ -1,20 +1,8 @@
 from HTMLComponent import *
 from GUIComponent import *
-
 from MenuList import MenuList
-
-from Tools.Directories import *
-
-from enigma import *
-
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
+from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename
+from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, eListbox, gFont, loadPNG
 
 def ChoiceEntryComponent(key, text):
        res = [ text ]
index 95f29b16b0bd3991712e8768c2aff032b1f9a49b..9a6031e6d57ce2b0ee447d7823133676830ceaaa 100644 (file)
@@ -2,10 +2,7 @@ from HTMLComponent 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:
index 391b887196f014bb33c5985f2dcd169487bc0f2c..7d35d9565ca2eb5556217cb47d26012ba2e31afe 100644 (file)
@@ -1,7 +1,5 @@
-import skin
 from GUIComponent import *
-
-from enigma import *
+from enigma import eTimer
 
 class ConditionalWidget(GUIComponent):
        def __init__(self, withTimer = True):
@@ -61,7 +59,7 @@ class BlinkingWidget(GUIComponent):
                if self.visible:
                        self.hide()
                self.timer.stop()
-               
+
 class BlinkingWidgetConditional(BlinkingWidget, ConditionalWidget):
        def __init__(self):
                BlinkingWidget.__init__(self)
index 902968d4a03f8d168f5f8935a09a02a41171bba0..ca209bda72a5087fc1879df92e0c6b1d5b762726 100644 (file)
@@ -2,7 +2,9 @@
 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
@@ -12,17 +14,6 @@ EPG_TYPE_SINGLE = 0
 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
index 7621ccb0dd9352469ff8dd28cc5923d352d003c6..b85b8ea337548a79dbb054245113e90e06c693c5 100644 (file)
@@ -2,21 +2,14 @@ from HTMLComponent import *
 from GUIComponent import *
 import re
 
+from os import path as os_path, listdir
 from MenuList import MenuList
 from Components.Harddisk import harddiskmanager
 
-from Tools.Directories import *
+from Tools.Directories import SCOPE_SKIN_IMAGE, resolveFilename
 
-from enigma import *
-
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
+from enigma import RT_HALIGN_LEFT, loadPNG, eListbox, eListboxPythonMultiContent, \
+       eServiceReference, eServiceCenter, gFont
 
 EXTENSIONS = {
                "mp3": "music",
@@ -111,11 +104,11 @@ class FileList(MenuList, HTMLComponent, GUIComponent):
                        directories.sort()
                        files.sort()
                else:
-                       files = os.listdir(directory)
+                       files = listdir(directory)
                        files.sort()
                        tmpfiles = files[:]
                        for x in tmpfiles:
-                               if os.path.isdir(directory + x):
+                               if os_path.isdir(directory + x):
                                        directories.append(directory + x + "/")
                                        files.remove(x)
                
index f060c37a81fe018c2f61e23ef3243c013b1636a9..fee1ed74d8652e4409776c1b1a9db2d0906cb0a5 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:
@@ -105,7 +105,7 @@ class Harddisk:
 
        def unmount(self):
                cmd = "/bin/umount " + self.devidex + "part*"
-               res = os.system(cmd)
+               res = system(cmd)
                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"
-               res = os.system(cmd)
+               res = system(cmd)
                return (res >> 8)
 
        def mount(self):
                cmd = "/bin/mount -t ext3 " + self.devidex + "part1 /hdd"
-               res = os.system(cmd)
+               res = system(cmd)
                return (res >> 8)
 
        def createMovieFolder(self):
-               res = os.system("mkdir " + resolveFilename(SCOPE_HDD))
+               res = system("mkdir " + resolveFilename(SCOPE_HDD))
                return (res >> 8)
                
        errorList = [ _("Everything is fine"), _("Creating partition failed"), _("Mkfs failed"), _("Mount failed"), _("Create movie folder failed"), _("Unmount failed")]
index 1bbf0bc04dbab57b475dbc8f3735fb56800ca4de..a27f247ed5cdfbda51ffefeefb2170850b54c779 100644 (file)
@@ -1,7 +1,6 @@
 import gettext
-import os
 
-from Tools.Directories import *
+from Tools.Directories import SCOPE_LANGUAGE, resolveFilename
 
 class Language:
        def __init__(self):
index e625d7c758cd2a57e03fa1aa0d78f8f9cf840236..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 d88b6280eab661a20e217bf3a429522ba45f2f2d..44937fa3de825429e47ad5a3cd20c47f6461ec92 100644 (file)
@@ -3,19 +3,10 @@ from GUIComponent import *
 
 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
@@ -32,7 +23,7 @@ ForwardIcon = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_mp_forward.png"))
 
 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
index 1da5a51995c9e7265431523aad01c61f6b105b4b..dcd99feacc8fd4f698f35dc42256994af1794310 100644 (file)
@@ -1,13 +1,10 @@
 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):
index 06ecde962bf3f0a9eb1c82f39eb96330f5512a8b..3031fb3ab605a7234fe020bc30560ad52b3d54bd 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 = ()
index 5add0c01913aa0560a268514c68fa1f9bf129d17..f65863dc55145470c93ce3dd85f694128afcf56a 100644 (file)
@@ -81,14 +81,12 @@ class Network:
                        print "[Network.py] parsing network failed"
 
        def deactivateNetworkConfig(self):
-               import os
                os.system("ip addr flush eth0")
                os.system("/etc/init.d/networking stop")
                os.system("killall -9 udhcpc")
                os.system("rm /var/run/udhcpc*")
 
        def activateNetworkConfig(self):
-               import os
                os.system("/etc/init.d/networking start")
                config.network.ip.value = self.getCurrentIP()
                config.network.ip.save()
index 9791e1b02691fb0503d0a13b1985a07f66cd4f80..02e88002c118683bb50bee58e4e313e1981a1748 100644 (file)
@@ -3,18 +3,9 @@ from GUIComponent import *
 
 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"))
 
index 120b4636751daa87c07d738835cb3432c7e8eaed..9425e56dcb4c3f35f324f43e7feefadd5c61d126 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
 
@@ -33,18 +33,18 @@ class PluginComponent:
        def readPluginList(self, directory):
                """enumerates plugins"""
                
-               categories = os.listdir(directory)
+               categories = os_listdir(directory)
                
                new_plugins = [ ]
                
                for c in categories:
                        directory_category = directory + c
-                       if not os.path.isdir(directory_category):
+                       if not os_path.isdir(directory_category):
                                continue
                        open(directory_category + "/__init__.py", "a").close()
-                       for pluginname in os.listdir(directory_category):
+                       for pluginname in os_listdir(directory_category):
                                path = directory_category + "/" + pluginname
-                               if os.path.isdir(path):
+                               if os_path.isdir(path):
                                        if fileExists(path + "/plugin.pyc") or fileExists(path + "/plugin.py"):
                                                try:
                                                        plugin = my_import('.'.join(["Plugins", c, pluginname, "plugin"]))
@@ -56,7 +56,7 @@ class PluginComponent:
                                                        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
index 9b9cfea86220f933d162e2aed42873b9da664427..fd988065e5b141e498d1f9f5724a453d496fd220 100644 (file)
@@ -4,9 +4,9 @@ from GUIComponent import *
 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 ]
index 234ae4ca0088fec32add36d5df6ffd18d19e40e7..0ab4a8158272e2d4329d97774e206eaac5710c72 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
@@ -24,7 +24,7 @@ class RFmod:
 
 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)
index 6145adefffae00fe418f2411cf313727e7c1bf3d..c2d58f2f0cb1199acedd7fe2e221440804a06f1e 100644 (file)
@@ -1,7 +1,7 @@
 from HTMLComponent import *
 from GUIComponent import *
 
-from enigma import *
+from enigma import loadPNG, eListboxServiceContent, eListbox, eServiceCenter, eServiceReference, gFont, eRect
 
 from string import upper
 
index d34d81fbdb5f57ede9cba1d39be72739dd1ef6ad..6f7082d545c661958fa98b1c318523b8270c9055 100644 (file)
@@ -1,6 +1,6 @@
 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):
index 2f60fcfb27d286820f1aa7b1e12ddabc38970af1..d2ccbb9c688ac960e1102ac5ba04b08da8cd8675 100644 (file)
@@ -4,22 +4,11 @@ from GUIComponent import *
 from Tools.FuzzyDate import FuzzyTime
 import time
 
-from enigma import eListboxPythonMultiContent, eListbox, gFont, loadPNG
+from enigma import eListboxPythonMultiContent, eListbox, gFont, loadPNG, \
+       RT_HALIGN_CENTER, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_VALIGN_CENTER
 from timer import TimerEntry
 from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE
 
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
-
-RT_WRAP = 32
-
-
 #
 #  | <Service>     <Name of the Timer>  |
 #  | <start, end>              <state>  |
index 704b765e2b17deb2e47db097a1071e6f01f5689a..ccc982797e8c466b521362ce9c2145c98d4a2ba2 100644 (file)
@@ -4,8 +4,6 @@ from xml.sax.handler import ContentHandler
 import os
 import time
 
-from enigma import *
-
 class Timezones:
        class parseTimezones(ContentHandler):
                def __init__(self, timezones):
@@ -42,7 +40,8 @@ class Timezones:
                try:
                        time.tzset()
                except:
-                       etimezone()
+                       from enigma import e_tzset
+                       e_tzset()
                
        def getTimezoneList(self):
                list = []
index 512defb54594c09804a6e6ccc61a1d5e500655d8..87159bf698672c11f39fa434886695d52c85fb4c 100644 (file)
@@ -1,4 +1,3 @@
-from enigma import *
 import time
 import sys
 
index 1cc01544a9d9cee4a0494e5215e5ca8ea947a838..9eb13df7f45d77d9359df97d1e4b1d6e3ad654cb 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
-       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
 
index e074aeecef2b65967cf98ef3d8a04c842a8d3a27..dae4d4abb7537b9c7b92219663824e75d9229809 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 Components.GUIComponent import *
 from Components.Pixmap import Pixmap
 from Components.FileList import FileEntryComponent, FileList
 from Screens.ChoiceBox import ChoiceBox
 from Plugins.Plugin import PluginDescriptor
 
-import os
-
 class Test(Screen):
        skin = """
                <screen position="100,100" size="550,400" title="Test" >
index 28ed7d64c8df8c5dd7645f18d1dcc349d6a91703..ba946f98ebfc04f973d503b75697d598014c8770 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.MultiContent import MultiContentEntryText, RT_HALIGN_RIGHT
+from Components.MultiContent import MultiContentEntryText
 from Components.ServiceEventTracker import ServiceEventTracker
 from Screens.InfoBarGenerics import InfoBarSeek, InfoBarCueSheetSupport
 from Components.GUIComponent import GUIComponent
-from enigma import eListboxPythonMultiContent, eListbox, gFont, iPlayableService
+from enigma import eListboxPythonMultiContent, eListbox, gFont, iPlayableService, RT_HALIGN_RIGHT
 from Screens.FixedMenu import FixedMenu
 import bisect
 
index d2b197193baa5d0a54856b3b216c7e9180ed3d2a..3cbef3437a565b4d6190e4138120ebb34f4e7e8d 100644 (file)
@@ -1,16 +1,9 @@
-from enigma import *
 from Screens.Screen import Screen
-from Screens.MessageBox import MessageBox
 from Components.ActionMap import NumberActionMap
-from Components.Label import Label
-from Components.Input import Input
-from Components.GUIComponent import *
 from Components.Pixmap import Pixmap
 from Components.FileList import FileEntryComponent, FileList
 from Plugins.Plugin import PluginDescriptor
 
-import os
-
 class FileManager(Screen):
        skin = """
                <screen position="100,100" size="550,400" title="Test" >
@@ -52,7 +45,7 @@ class FileManager(Screen):
                self["text"].right()
        
        def ok(self):
-               
+       
                if self["list"].canDescent(): # isDir
                        self["list"].descent()
                else:
index 5fc35ee1ddef4eeda3a2450aabc3175fe8ef535e..71f2f1c803a5d01d25342aff09d20fb7bb680cd6 100644 (file)
@@ -1,6 +1,6 @@
 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('.')
@@ -9,7 +9,7 @@ def getExtension(file):
        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):
@@ -128,12 +128,12 @@ def ScanDevice(mountpoint):
 
        # now scan the paths    
        for p in paths_to_scan:
-               path = os.path.join(mountpoint, p.path)
+               path = os_path.join(mountpoint, p.path)
 
-               for root, dirs, files in os.walk(path):
+               for root, dirs, files in os_walk(path):
                        for f in files:
                                ext = getExtension(f)
-                               pathname = os.path.join(root, f)
+                               pathname = os_path.join(root, f)
                                for s in scanner:
                                        s.handleFile(res, pathname, ext)
 
index 8db85cedabce8091115f15cdf45f367a83429333..34e8c10f471e017e021d224458ef6f3cce1e13d0 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
@@ -15,7 +14,6 @@ from Components.AVSwitch import AVSwitch
 
 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"))])
index 88db4857973361a7ff85eb2b3a7a09f9ec7e4a33..49da5e632ae86a898d7684273d797389cdc1554b 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.MultiContent import MultiContentEntryText, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_WRAP
+from Components.MultiContent import MultiContentEntryText
 from Plugins.Plugin import PluginDescriptor
-from enigma import eListboxPythonMultiContent, eListbox, gFont, iServiceInformation
+from enigma import eListboxPythonMultiContent, eListbox, gFont, iServiceInformation, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_WRAP
 
 from twisted.web import server
 from twisted.web.resource import Resource
index 8d4e15816648729a910730062ab2a39bc21f9064..5142d16b3ccc3efa30a934d7af937c159bc394ee 100644 (file)
@@ -1,14 +1,9 @@
 # must be fixed for the new plugin interface
-from enigma import *
-from Screens.Screen import Screen
-from Screens.MessageBox import MessageBox
-from Components.ActionMap import ActionMap
-from Components.Label import Label
 from Tools.BoundFunction import boundFunction
 from Tools.Directories import pathExists
 from Plugins.Plugin import PluginDescriptor
 
-import os
+from os import listdir
 
 TUXBOX_PLUGINS_PATH = "/usr/lib/tuxbox/plugins/"
 
@@ -16,7 +11,7 @@ def getPlugins():
        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":
index fae1f26d24bddb735ab01dd231cdc4645b44ec85..05a2824a2950a4593e18db778bc664eab320abc1 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 Components.Pixmap import *
 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 *
-import os
-import string
-import time
-import datetime
+from os import path, makedirs, listdir
+from time import localtime
+from datetime import date
 
 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..."
-               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!"
@@ -129,10 +126,10 @@ class BackupSetup(Screen):
 
        def runBackup(self, result):
                if result:
-                       if os.path.ismount(MountPoints[self.backup.location.value]):
+                       if path.ismount(MountPoints[self.backup.location.value]):
                                self.createBackupfolders()
-                               d = time.localtime()
-                               dt = datetime.date(d.tm_year, d.tm_mon, d.tm_mday)
+                               d = localtime()
+                               dt = date(d.tm_year, d.tm_mon, d.tm_mday)
                                self.path = BackupPath[self.backup.location.value]
                                if self.backup.type.value == "full":
                                        print "Backup Mode: Full"
@@ -194,9 +191,9 @@ class RestoreMenu(Screen):
        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
index 72279c1a11ce11fe2d63eeac1b4752c115df7815..0f6c4e846cdb6ec197332d9f02bc5255f5bc41fc 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
@@ -10,7 +10,7 @@ from Components.Input import Input
 from Screens.Console import Console
 from Plugins.Plugin import PluginDescriptor
 
-import os
+from os import popen
 
 class Upgrade(Screen):
        skin = """
@@ -43,7 +43,7 @@ class Upgrade(Screen):
                        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
@@ -58,15 +58,6 @@ class Upgrade(Screen):
                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 ]
        
@@ -122,13 +113,13 @@ class Ipkg(Screen):
                
 
        def fillPacketList(self):
-               lines = os.popen("ipkg list", "r").readlines()
+               lines = popen("ipkg list", "r").readlines()
                packetlist = []
                for x in lines:
                        split = x.split(' - ')
                        packetlist.append([split[0].strip(), split[1].strip()])
                
-               lines = os.popen("ipkg list_installed", "r").readlines()
+               lines = popen("ipkg list_installed", "r").readlines()
                
                installedlist = {}
                for x in lines:
@@ -151,7 +142,7 @@ class Ipkg(Screen):
                        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
index 4d9e611d857dd7dc25a1382410a0fd0066fffa25..db16f77f7172b814a4f35724b5d57807ec2eaaa7 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
@@ -140,12 +140,12 @@ class PositionerSetup(Screen):
                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"
@@ -446,8 +446,8 @@ class TunerScreen(ScanSetup):
                        self.createSetup()
 
        def createConfig(self, foo):
+               global tuning
                if not tuning:
-                       global tuning
                        tuning = ConfigSubsection()
                        tuning.type = ConfigSelection(
                                default = "manual_transponder",
index 6325a82f10d215fcb34cd5b6d293940348d8146d..89fbc4bb533b57ba8dde4831ba3e284a7d246035 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
@@ -56,12 +56,12 @@ class Satfinder(ScanSetup):
                </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"
index 844b75f9e3c5b21e6d54e02cb5884eb7a6be22dc..18ffd9943fb9c2a898df63e7a6e190e12e6bb033 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!
-
-from enigma import *
 from Screens.Screen import Screen
 from Screens.MessageBox import MessageBox
 from Components.ActionMap import NumberActionMap
 from Components.Pixmap import Pixmap
-from Components.GUIComponent import *
 from Components.MenuList import MenuList
 from Plugins.Plugin import PluginDescriptor
-
 from Components.config import config
 from Tools.Directories import SCOPE_SKIN
-
 from Components.config import config
 
-import os, sys
+from os import path, walk
 
 class SkinSelector(Screen):
        # for i18n:
@@ -40,7 +35,7 @@ class SkinSelector(Screen):
                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)
@@ -107,7 +102,7 @@ class SkinSelector(Screen):
                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"
 
index dc494e6f1517a1ff08ce7611b7eeb3a4b6e47b25..b5034b63e3e6700a8a42437ec47a55222e305b04 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
@@ -14,7 +14,7 @@ from Components.Ipkg import Ipkg
 from Components.Slider import Slider
 from Components.Label import Label
 
-import os
+from os import popen
 
 class UpdatePluginMenu(Screen):
        skin = """
@@ -125,15 +125,6 @@ class IPKGSource(Screen):
                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 ]
        
@@ -189,13 +180,13 @@ class Ipkg2(Screen):
                
 
        def fillPacketList(self):
-               lines = os.popen("ipkg list", "r").readlines()
+               lines = popen("ipkg list", "r").readlines()
                packetlist = []
                for x in lines:
                        split = x.split(' - ')
                        packetlist.append([split[0].strip(), split[1].strip()])
                
-               lines = os.popen("ipkg list_installed", "r").readlines()
+               lines = popen("ipkg list_installed", "r").readlines()
                
                installedlist = {}
                for x in lines:
@@ -218,7 +209,7 @@ class Ipkg2(Screen):
                        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
index 0eff5967d90dec913c424db9588f04ac9f71ee7a..9cbb42210dc3ce4e0adcf2f26d4b4f6b4698e2b0 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 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
index a20983e61bf43db7eb93636b122381d1ef1bd8ad..37729887c744678514c0cb1cb5f2661bd8784993 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 Components.GUIComponent import *
 from Components.ChoiceList import ChoiceEntryComponent, ChoiceList
 
-import os
-
 class ChoiceBox(Screen):
        def __init__(self, session, title = "", list = [], keys = None, selection = 0):
                Screen.__init__(self, session)
index c3302a1c7999ad4b6cd53ede20294cac017143d2..27ca5aa39cb0f1c0074856939cbf2c0a7143333f 100644 (file)
@@ -6,8 +6,6 @@ from Components.Header import Header
 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
 
index bcc35807fdb522a0055a0cc2f9279fda6350a642..a34f0c5794ec6e5d8e06df82530e2332ed5690aa 100644 (file)
@@ -5,7 +5,7 @@ from Components.Pixmap import Pixmap
 from Components.Button import Button
 from Components.config import config
 
-from enigma import *
+from enigma import eDVBSatelliteEquipmentControl
 
 class Dish(Screen):
        def __init__(self, session):
index 5d29df0d1410e0875c7081081f240657a720b2c9..0483f98b381cc4bf4c2f4b515e9b825fa6ce0d26 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 enigma import eServiceReference, eServiceEventPtr
+from enigma import eServiceReference
 from Screens.FixedMenu import FixedMenu
 from RecordTimer import RecordTimerEntry, parseEvent
 from TimerEdit import TimerEditList
index 82bca9fddc106088a0b5055755dcdd6390939625..8504165db222f1faedfcc610ea12dbb349fe0176 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 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
index f11238425f60eca004e344f349ba501051cf4e1d..24c2b40bc5fdb296056ae360249f74429c99e86f 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 ServiceReference import ServiceReference
 
 from Components.Sources.Clock import Clock
-from Components.ActionMap import ActionMap, HelpableActionMap
+from Components.ActionMap import HelpableActionMap
 from Components.config import config
 
 from Tools.Notifications import AddNotificationWithCallback
@@ -23,10 +22,6 @@ from Screens.InfoBarGenerics import InfoBarShowHide, \
 
 from Screens.HelpMenu import HelpableScreen, HelpMenu
 
-from enigma import *
-
-import time
-
 class InfoBar(InfoBarShowHide,
        InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRadioText,
        InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, 
index 26bc0d419b91207e3963a6c1288847d45fbbd46f..646419c3fb387319e731ac9766f148fb58e03990 100644 (file)
@@ -36,14 +36,14 @@ from Screens.SleepTimerEdit import SleepTimerEdit
 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
@@ -953,7 +953,6 @@ class InfoBarTimeshift:
                        print "hu, timeshift already enabled?"
                else:
                        if not ts.startTimeshift():
-                               import time
                                self.timeshift_enabled = 1
 
                                # we remove the "relative time" for now.
@@ -1240,8 +1239,8 @@ class InfoBarInstantRecord:
                except:
                        pass
 
-               begin = time.time()
-               end = time.time() + 3600 * 10
+               begin = time()
+               end = time() + 3600 * 10
                name = "instant record"
                description = ""
                eventid = None
@@ -1320,7 +1319,7 @@ class InfoBarInstantRecord:
 
        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
@@ -1536,8 +1535,8 @@ class InfoBarAdditionalInfo:
                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):
@@ -1729,7 +1728,7 @@ class InfoBarCueSheetSupport:
                        return None
 
        def addMark(self, point):
-               bisect.insort(self.cut_list, point)
+               insort(self.cut_list, point)
                self.uploadCuesheet()
 
        def removeMark(self, point):
index bb8b63d90af90188e4f484d3457b6ecdd4cdbf28..6cdb42ee8da47f47e5fba6eaec372a94a8dd1ac0 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 Components.GUIComponent import *
 from Tools.BoundFunction import boundFunction
 from time import time
 
-import os
-
 class InputBox(Screen):
        def __init__(self, session, title = "", windowTitle = _("Input"), **kwargs):
                Screen.__init__(self, session)
@@ -165,4 +162,4 @@ class PinInput(InputBox):
                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 1411b427d4d1ca19fc0a14a722d274431f8c152f..4e299b27b75bf21f2316e7ce632b3c2fbcbb547b 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.GUIComponent import *
 from Components.Pixmap import Pixmap
 from Components.Label import Label
 from Components.FileList import FileEntryComponent, FileList
index b2c8a4d9c7ee4538eeef40648ed245ccb1af3197..f7b2abf700b6ff0252a6ecce73d2ab0b455c9a8a 100644 (file)
@@ -3,8 +3,6 @@ from Screen import Screen
 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)
index 7c4c3ecff781ef3520b1b2bdaf5cd519ca3094c8..045e8fb72d0b40dcb326fdfb183150272732ef44 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 Tools.Directories import resolveFilename, SCOPE_CONFIG
 from Tools.BoundFunction import boundFunction
 from ServiceReference import ServiceReference
 from enigma import eServiceCenter, eServiceReference, eTimer
-import os
-import operator
+from operator import itemgetter
 
 class ProtectedScreen:
        def __init__(self):
@@ -192,7 +190,7 @@ class ParentalControlEditor(Screen):
                        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)
 
index af313930078f8818fdd97ce52af465d4bf35929e..67c5b84b472858d655ef48f58dc343279189e671 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 Components.GUIComponent import *
 from Components.ChoiceList import ChoiceEntryComponent, ChoiceList
 
-import os
-
 # this is not so great.
 MAX_X = 720
 MAX_Y = 576
index 329300a1428649ec892908681560f7011de427e4..dc511448d1fcd0cb123a01db14b20b25f50f28ba 100644 (file)
@@ -1,10 +1,7 @@
 from Screen import Screen
 from MessageBox import MessageBox
-
 from Components.AVSwitch import AVSwitch
 
-from enigma import *
-
 class Scart(Screen):
        def __init__(self, session, start_visible=True):
                Screen.__init__(self, session)
index 9e3ade454ddf8f5ad15b3bd406588ff2781344ab..064171f151eff5628fe39a3c148875e963936992 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 enigma import *
+from enigma import eDVBVolumecontrol, eDBoxLCD
 
 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 92484735f34968b30848b92515a795e51a94c3ca..090585bd641e02a3e7b2198c614a0fc89ea37fd2 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/picexif.h>
 #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>
-
-%template(eServiceCenterPtr) ePtr<eServiceCenter>;
 %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/gdi/picexif.h>
 %include <lib/gdi/picload.h>
 /**************  eptr  **************/
 
-%template(eActionMapPtr) ePtr<eActionMap>;
-
 /**************  signals  **************/
 
 template<class R> class PSignal0
index d0fe92a878c40dc560f5a46f0c080c4ead3b88de..76d2d197a52e73924a114769b24516f2e7180506 100644 (file)
@@ -157,7 +157,7 @@ public:
        TestObj();
        ~TestObj();
 };
-TEMPLATE_TYPEDEF(ePtr<TestObj>, TestObjPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<TestObj>, TestObjPtr);
 
 #ifndef SWIG
 extern PyObject *New_TestObj();
index c094b6462eab53ac69dc46b3a75f57e1a0c71156..da787eeaab1e5f2e91678a1ab99174fdb73484bd 100644 (file)
@@ -2,29 +2,27 @@
 #define __lib_python_swig_h
 
 #ifdef SWIG
-#define TEMPLATE_TYPEDEF(x, y) \
-%template(y) x; \
-typedef x y; \
-%typemap_output_ptr(x);
-#define SWIG_ALLOW_OUTPUT_SIMPLE(x) %typemap_output_simple(x);
-#else
-#define TEMPLATE_TYPEDEF(x, y) typedef x y
-#define SWIG_ALLOW_OUTPUT_SIMPLE(x) 
-#endif
-
-
-#ifdef SWIG
+#define SWIG_IGNORE(x) %ignore x
+#define SWIG_EXTEND(x, code) %extend x { code }
+#define SWIG_TEMPLATE_TYPEDEF(x, y) %template(y) x; %typemap_output_ptr(x)
+#define SWIG_TEMPLATE_TYPEDEF_REPLACE(x, y) %template(y##_REPLACE) x; %typemap_output_ptr(x)
+#define SWIG_ALLOW_OUTPUT_SIMPLE(x) %typemap_output_simple(x)
 #define SWIG_INPUT INPUT
 #define SWIG_OUTPUT OUTPUT
 #define SWIG_NAMED_OUTPUT(x) OUTPUT
 #define SWIG_VOID(x) void
 #define SWIG_PYOBJECT(x) PyObject*
 #else
+#define SWIG_IGNORE(x)
+#define SWIG_EXTEND(x, code)
+#define SWIG_TEMPLATE_TYPEDEF(x, y)
+#define SWIG_TEMPLATE_TYPEDEF_REPLACE(x, y)
+#define SWIG_ALLOW_OUTPUT_SIMPLE(x)
 #define SWIG_INPUT
 #define SWIG_OUTPUT
 #define SWIG_NAMED_OUTPUT(x) x
 #define SWIG_VOID(x) x
 #define SWIG_PYOBJECT(x) x
-#endif
+#endif  // SWIG
 
-#endif
+#endif  // __lib_python_swig_h
index 25b9d0b7df4e463ba7a51c942c7c3dbc080ae381..d1e1d08bb46eeca4436c2f7cc25274300f86d00e 100644 (file)
@@ -3,13 +3,15 @@
 
 #ifndef SWIG
 #include <time.h>
-#include <lib/base/object.h>
-#include <lib/service/iservice.h>
 #include <list>
 #include <string>
 class Event;
 #endif
 
+#include <lib/base/object.h>
+#include <lib/service/iservice.h>
+
+SWIG_IGNORE(eComponentData);
 struct eComponentData
 {
 DECLARE_REF(eComponentData);
@@ -26,9 +28,9 @@ DECLARE_REF(eComponentData);
        std::string getIso639LanguageCode(void) const { return m_iso639LanguageCode; }
        std::string getText(void) const { return m_text; }
 };
+SWIG_TEMPLATE_TYPEDEF(ePtr<eComponentData>, eComponentDataPtr);
 
-TEMPLATE_TYPEDEF(ePtr<eComponentData>, eComponentDataPtr);
-
+SWIG_IGNORE(eServiceEvent);
 class eServiceEvent: public iObject
 {
        DECLARE_REF(eServiceEvent);
@@ -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;
 };
+SWIG_TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
 
-TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
 #ifndef SWIG
-
+SWIG_IGNORE(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); }
 };
-
-// TEMPLATE_TYPEDEF(ePtr<eDebugClass>, eDebugClassPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<eDebugClass>, eDebugClassPtr);
 #endif
 
 #endif
index c809e813db440f2467e96339bf686ae14a03291b..98ece76eab5d2edbefd075b6d18b1bb48792994f 100644 (file)
@@ -224,8 +224,9 @@ typedef long long pts_t;
           
           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
@@ -234,7 +235,7 @@ class iStaticServiceInformation: public iObject
 #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);
@@ -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 setInfo(const eServiceReference &ref, int w, int v);
        virtual int setInfoString(const eServiceReference &ref, int w, const char *v);
 };
+SWIG_TEMPLATE_TYPEDEF(ePtr<iStaticServiceInformation>, iStaticServiceInformationPtr);
 
-TEMPLATE_TYPEDEF(ePtr<iStaticServiceInformation>, iStaticServiceInformationPtr);
-
-class iServiceInformation: public iObject
+class iServiceInformation_ENUMS
 {
 #ifdef SWIG
-       iServiceInformation();
-       ~iServiceInformation();
+       iServiceInformation_ENUMS();
+       ~iServiceInformation_ENUMS();
 #endif
 public:
-       virtual SWIG_VOID(RESULT) getName(std::string &SWIG_OUTPUT)=0;
-       virtual SWIG_VOID(RESULT) getEvent(ePtr<eServiceEvent> &SWIG_OUTPUT, int nownext);
-
        enum {
-               sIsCrypted,  /* is encrypted (no indication if decrypt was possible) */
-               sAspect,     /* aspect ratio: 0=4:3, 1=16:9, 2=whatever we need */
-               sIsMultichannel, /* multichannel *available* (probably not selected) */
-               
+               sIsCrypted,             /* is encrypted (no indication if decrypt was possible) */
+               sAspect,                /* aspect ratio: 0=4:3, 1=16:9, 2=whatever we need */
+               sIsMultichannel,        /* multichannel *available* (probably not selected) */
+
                        /* "user serviceable info" - they are not reliable. Don't use them for anything except the service menu!
-                          that's also the reason why they are so globally defined. 
-                          
-                          
+                          that's also the reason why they are so globally defined.
                           again - if somebody EVER tries to use this information for anything else than simply displaying it,
                           i will change this to return a user-readable text like "zero x zero three three" (and change the
-                          exact spelling in every version) to stop that!
-                       */
+                          exact spelling in every version) to stop that! */
+
                sVideoPID,
                sAudioPID,
                sPCRPID,
                sPMTPID,
                sTXTPID,
-               
+
                sSID,
                sONID,
                sTSID,
                sNamespace,
                sProvider,
-               
+
                sDescription,
                sServiceref,
-               sTimeCreate,    // unix time or string
-               
+               sTimeCreate,            /* unix time or string */
+
                sTitle,
                sArtist,
                sAlbum,
@@ -297,34 +292,60 @@ public:
                sTracknumber,
                sGenre,
                sCAIDs,
-               sVideoType,  // MPEG2 MPEG4
-               
-               sTags,  /* space seperated list of tags */
-               
-               sDVBState, /* states as defined in pmt handler (as events there) */
+               sVideoType,             /* MPEG2 MPEG4 */
+
+               sTags,                          /* space seperated list of tags */
+
+               sDVBState,                      /* states as defined in pmt handler (as events there) */
 
                sVideoHeight,
                sVideoWidth,
-               
-               sTransponderData /* transponderdata as python dict */
+
+               sTransponderData        /* transponderdata as python dict */
+       };
+       enum {
+               resNA = -1,
+               resIsString = -2,
+               resIsPyObject = -3
        };
-       enum { resNA = -1, resIsString = -2, resIsPyObject = -3 };
+};
+
+/* some words to structs like struct iServiceInformation_ENUMS
+For some classes we need in python just the SmartPointer Variants.
+So we prevent building wrapper classes for the non smart pointer classes with the SWIG_IGNORE makro.
+But now we have the problem that swig do not export enums for smart pointer classes (i dont know why).
+So we move all enum's to own classes (with _ENUMS as name ending) and let our real
+class inherit from the *_ENUMS class. This *_ENUMS classes are normally exportet via swig to python.
+But in the python code we doesn't like to write iServiceInformation_ENUMS.sVideoType....
+we like to write iServiceInformation.sVideoType.
+So until swig have no Solution for this Problem we call in lib/python/Makefile.am a python script named
+enigma_py_patcher.py to remove the "_ENUMS" strings in enigma.py at all needed locations. */
+
+SWIG_IGNORE(iServiceInformation);
+class iServiceInformation: public iServiceInformation_ENUMS, public iObject
+{
+#ifdef SWIG
+       iServiceInformation();
+       ~iServiceInformation();
+#endif
+public:
+       virtual SWIG_VOID(RESULT) getName(std::string &SWIG_OUTPUT)=0;
+       virtual SWIG_VOID(RESULT) getEvent(ePtr<eServiceEvent> &SWIG_OUTPUT, int nownext);
 
        virtual int getInfo(int w);
        virtual std::string getInfoString(int w);
        virtual PyObject *getInfoObject(int w);
-       
+
        virtual int setInfo(int w, int v);
        virtual int setInfoString(int w, const char *v);
 };
+SWIG_TEMPLATE_TYPEDEF(ePtr<iServiceInformation>, iServiceInformationPtr);
 
-TEMPLATE_TYPEDEF(ePtr<iServiceInformation>, iServiceInformationPtr);
-
-class iFrontendInformation: public iObject
+class iFrontendInformation_ENUMS
 {
 #ifdef SWIG
-       iFrontendInformation();
-       ~iFrontendInformation();
+       iFrontendInformation_ENUMS();
+       ~iFrontendInformation_ENUMS();
 #endif
 public:
        enum {
@@ -335,12 +356,22 @@ public:
                syncState,
                frontendNumber
        };
+};
+
+SWIG_IGNORE(iFrontendInformation);
+class iFrontendInformation: public iFrontendInformation_ENUMS, public iObject
+{
+#ifdef SWIG
+       iFrontendInformation();
+       ~iFrontendInformation();
+#endif
+public:
        virtual int getFrontendInfo(int w)=0;
        virtual PyObject *getFrontendData(bool original=false)=0;
 };
+SWIG_TEMPLATE_TYPEDEF(ePtr<iFrontendInformation>, iFrontendInformationPtr);
 
-TEMPLATE_TYPEDEF(ePtr<iFrontendInformation>, iFrontendInformationPtr);
-
+SWIG_IGNORE(iPauseableService);
 class iPauseableService: public iObject
 {
 #ifdef SWIG
@@ -350,15 +381,25 @@ class iPauseableService: public iObject
 public:
        virtual RESULT pause()=0;
        virtual RESULT unpause()=0;
-       
+
                /* hm. */
        virtual RESULT setSlowMotion(int ratio=0)=0;
        virtual RESULT setFastForward(int ratio=0)=0;
 };
+SWIG_TEMPLATE_TYPEDEF(ePtr<iPauseableService>, iPauseableServicePtr);
 
-TEMPLATE_TYPEDEF(ePtr<iPauseableService>, iPauseableServicePtr);
+class iSeekableService_ENUMS
+{
+#ifdef SWIG
+       iSeekableService_ENUMS();
+       ~iSeekableService_ENUMS();
+#endif
+public:
+       enum { dirForward = +1, dirBackward = -1 };
+};
 
-class iSeekableService: public iObject
+SWIG_IGNORE(iSeekableService);
+class iSeekableService: public iSeekableService_ENUMS, public iObject
 {
 #ifdef SWIG
        iSeekableService();
@@ -367,16 +408,14 @@ class iSeekableService: public iObject
 public:
        virtual RESULT getLength(pts_t &SWIG_OUTPUT)=0;
        virtual RESULT seekTo(pts_t to)=0;
-       enum { dirForward = +1, dirBackward = -1 };
        virtual RESULT seekRelative(int direction, pts_t to)=0;
        virtual RESULT getPlayPosition(pts_t &SWIG_OUTPUT)=0;
-               /* if you want to do several seeks in a row, you can enable the trickmode. 
+               /* if you want to do several seeks in a row, you can enable the trickmode.
                   audio will be switched off, sync will be disabled etc. */
        virtual RESULT setTrickmode(int trick=0)=0;
        virtual RESULT isCurrentlySeekable()=0;
 };
-
-TEMPLATE_TYPEDEF(ePtr<iSeekableService>, iSeekableServicePtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<iSeekableService>, iSeekableServicePtr);
 
 struct iAudioTrackInfo
 {
@@ -387,9 +426,9 @@ struct iAudioTrackInfo
        std::string getDescription() { return m_description; }
        std::string getLanguage() { return m_language; }
 };
-
 SWIG_ALLOW_OUTPUT_SIMPLE(iAudioTrackInfo);
 
+SWIG_IGNORE(iAudioTrackSelection);
 class iAudioTrackSelection: public iObject
 {
 #ifdef SWIG
@@ -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;
 };
+SWIG_TEMPLATE_TYPEDEF(ePtr<iAudioTrackSelection>, iAudioTrackSelectionPtr);
 
-TEMPLATE_TYPEDEF(ePtr<iAudioTrackSelection>, iAudioTrackSelectionPtr);
+class iAudioChannelSelection_ENUMS
+{
+#ifdef SWIG
+       iAudioChannelSelection_ENUMS();
+       ~iAudioChannelSelection_ENUMS();
+#endif
+public:
+       enum { LEFT, STEREO, RIGHT };
+};
 
-class iAudioChannelSelection: public iObject
+SWIG_IGNORE(iAudioChannelSelection);
+class iAudioChannelSelection: public iAudioChannelSelection_ENUMS, public iObject
 {
 #ifdef SWIG
        iAudioChannelSelection();
        ~iAudioChannelSelection();
 #endif
 public:
-       enum { LEFT, STEREO, RIGHT };
        virtual int getCurrentChannel()=0;
        virtual RESULT selectChannel(int i)=0;
 };
+SWIG_TEMPLATE_TYPEDEF(ePtr<iAudioChannelSelection>, iAudioChannelSelectionPtr);
 
-TEMPLATE_TYPEDEF(ePtr<iAudioChannelSelection>, iAudioChannelSelectionPtr);
-
+SWIG_IGNORE(iAudioDelay);
 class iAudioDelay: public iObject
 {
 #ifdef SWIG
@@ -430,9 +478,9 @@ public:
        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
@@ -442,9 +490,9 @@ class iRadioText: public iObject
 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
@@ -455,9 +503,9 @@ public:
        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
@@ -467,34 +515,44 @@ class iTimeshiftService: public iObject
 public:
        virtual RESULT startTimeshift()=0;
        virtual RESULT stopTimeshift()=0;
-       
+
        virtual int isTimeshiftActive()=0;
                        /* this essentially seeks to the relative end of the timeshift buffer */
        virtual RESULT activateTimeshift()=0;
 };
-
-TEMPLATE_TYPEDEF(ePtr<iTimeshiftService>, iTimeshiftServicePtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<iTimeshiftService>, iTimeshiftServicePtr);
 
        /* not related to eCueSheet */
-class iCueSheet: public iObject
+
+class iCueSheet_ENUMS
+{
+#ifdef SWIG
+       iCueSheet_ENUMS();
+       ~iCueSheet_ENUMS();
+#endif
+public:
+       enum { cutIn = 0, cutOut = 1, cutMark = 2 };
+};
+
+SWIG_IGNORE(iCueSheet);
+class iCueSheet: public iCueSheet_ENUMS, public iObject
 {
 #ifdef SWIG
        iCueSheet();
        ~iCueSheet();
 #endif
 public:
-                       /* returns a list of (pts, what)-tuples */
+       /* returns a list of (pts, what)-tuples */
        virtual PyObject *getCutList() = 0;
        virtual void setCutList(SWIG_PYOBJECT(ePyObject) list) = 0;
        virtual void setCutListEnable(int enable) = 0;
-       enum { cutIn = 0, cutOut = 1, cutMark = 2 };
 };
-
-TEMPLATE_TYPEDEF(ePtr<iCueSheet>, iCueSheetPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<iCueSheet>, iCueSheetPtr);
 
 class eWidget;
 class PyList;
 
+SWIG_IGNORE(iSubtitleOutput);
 class iSubtitleOutput: public iObject
 {
 public:
@@ -503,42 +561,134 @@ public:
        virtual PyObject *getSubtitleList()=0;
        virtual PyObject *getCachedSubtitle()=0;
 };
+SWIG_TEMPLATE_TYPEDEF(ePtr<iSubtitleOutput>, iSubtitleOutputPtr);
 
-TEMPLATE_TYPEDEF(ePtr<iSubtitleOutput>, iSubtitleOutputPtr);
+SWIG_IGNORE(iMutableServiceList);
+class iMutableServiceList: public iObject
+{
+#ifdef SWIG
+       iMutableServiceList();
+       ~iMutableServiceList();
+#endif
+public:
+               /* flush changes */
+       virtual RESULT flushChanges()=0;
+               /* adds a service to a list */
+       virtual RESULT addService(eServiceReference &ref, eServiceReference before=eServiceReference())=0;
+               /* removes a service from a list */
+       virtual RESULT removeService(eServiceReference &ref)=0;
+               /* moves a service in a list, only if list suppports a specific sort method. */
+               /* pos is the new, absolute position from 0..size-1 */
+       virtual RESULT moveService(eServiceReference &ref, int pos)=0;
+               /* set name of list, for bouquets this is the visible bouquet name */
+       virtual RESULT setListName(const std::string &name)=0;
+};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iMutableServiceList>, iMutableServiceListPtr);
 
-class iPlayableService: public iObject
+SWIG_IGNORE(iListableService);
+class iListableService: public iObject
 {
 #ifdef SWIG
-       iPlayableService();
-       ~iPlaybleService();
+       iListableService();
+       ~iListableService();
 #endif
-       friend class iServiceHandler;
 public:
-       enum
+#ifndef SWIG
+               /* legacy interface: get a list */
+       virtual RESULT getContent(std::list<eServiceReference> &list, bool sorted=false)=0;
+#endif
+       virtual PyObject *getContent(const char* format, bool sorted=false)=0;
+
+               /* new, shiny interface: streaming. */
+       virtual SWIG_VOID(RESULT) getNext(eServiceReference &SWIG_OUTPUT)=0;
+
+               /* use this for sorting. output is not sorted because of either
+                - performance reasons: the whole list must be buffered or
+                - the interface would be restricted to a list. streaming
+                  (as well as a future "active" extension) won't be possible.
+               */
+       virtual int compareLessEqual(const eServiceReference &, const eServiceReference &)=0;
+
+       virtual SWIG_VOID(RESULT) startEdit(ePtr<iMutableServiceList> &SWIG_OUTPUT)=0;
+};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iListableService>, iListableServicePtr);
+
+#ifndef SWIG
+       /* a helper class which can be used as argument to stl's sort(). */
+class iListableServiceCompare
+{
+       ePtr<iListableService> m_list;
+public:
+       iListableServiceCompare(iListableService *list): m_list(list) { }
+       bool operator()(const eServiceReference &a, const eServiceReference &b)
        {
+               return m_list->compareLessEqual(a, b);
+       }
+};
+#endif
+
+SWIG_IGNORE(iServiceOfflineOperations);
+class iServiceOfflineOperations: public iObject
+{
+#ifdef SWIG
+       iServiceOfflineOperations();
+       ~iServiceOfflineOperations();
+#endif
+public:
+               /* to delete a service, forever. */
+       virtual RESULT deleteFromDisk(int simulate=1)=0;
+
+               /* for transferring a service... */
+       virtual SWIG_VOID(RESULT) getListOfFilenames(std::list<std::string> &SWIG_OUTPUT)=0;
+
+               // TODO: additional stuff, like a conversion interface?
+};
+SWIG_TEMPLATE_TYPEDEF(ePtr<iServiceOfflineOperations>, iServiceOfflineOperationsPtr);
+
+class iPlayableService_ENUMS
+{
+#ifdef SWIG
+       iPlayableService_ENUMS();
+       ~iPlayableService_ENUMS();
+#endif
+public:
+       enum {
                        /* these first two events are magical, and should only
                           be generated if you know what you're doing. */
                evStart,
                evEnd,
-               
+
                evTuneFailed,
-                       // when iServiceInformation is implemented:
+
+                       /* when iServiceInformation is implemented:*/
                evUpdatedEventInfo,
                evUpdatedInfo,
 
-                       /* when seek() is implemented: */               
+                       /* when seek() is implemented: */
                evSeekableStatusChanged, /* for example when timeshifting */
-               
+
                evEOF,
                evSOF, /* bounced against start of file (when seeking backwards) */
-               
-                       /* only when cueSheet is implemented */
+
+                       /* when cueSheet is implemented */
                evCuesheetChanged,
 
+                       /* when radioText is implemented */
                evUpdatedRadioText,
 
                evVideoSizeChanged
        };
+};
+
+SWIG_IGNORE(iPlayableService);
+class iPlayableService: public iPlayableService_ENUMS, public iObject
+{
+#ifdef SWIG
+       iPlayableService();
+       ~iPlaybleService();
+#endif
+       friend class iServiceHandler;
+public:
 #ifndef SWIG
        virtual RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection)=0;
 #endif
@@ -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;
 };
+SWIG_TEMPLATE_TYPEDEF(ePtr<iPlayableService>, iPlayableServicePtr);
 
-TEMPLATE_TYPEDEF(ePtr<iPlayableService>, iPlayableServicePtr);
-
-class iRecordableService: public iObject
+class iRecordableService_ENUMS
 {
 #ifdef SWIG
-       iRecordableService();
-       ~iRecordableService();
+       iRecordableService_ENUMS();
+       ~iRecordableService_ENUMS();
 #endif
 public:
-       enum
-       {
+       enum {
                evStart,
                evStop,
                evTunedIn,
@@ -579,10 +727,9 @@ public:
                evRecordStopped,
                evNewProgramInfo,
                evRecordFailed
-//             evDiskFull
+               /*evDiskFull*/
        };
-       enum
-       {
+       enum {
                NoError=0,
                errOpenRecordFile=-1,
                errNoDemuxAvailable=-2,
@@ -590,6 +737,16 @@ public:
                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
@@ -599,8 +756,7 @@ public:
        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
 
@@ -625,90 +781,7 @@ inline ePyObject Impl_New_iRecordableServicePtr(const ePtr<iRecordableService> &
 #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
@@ -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;
 };
-
-TEMPLATE_TYPEDEF(ePtr<iServiceHandler>, iServiceHandlerPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<iServiceHandler>, iServiceHandlerPtr);
 
 #endif
index 813da24c5ee967207cbca212e4e71be4c9d3e627..77173c53a60a48b3c4610962da19fdaa8a90ef8a 100644 (file)
@@ -7,13 +7,15 @@
 
 class eServiceCenter;
 
+#ifndef SWIG
 typedef ePtr<eServiceCenter> eServiceCenterPtr;
+#endif
 
 class eServiceCenter: public iServiceHandler
 {
 DECLARE_REF(eServiceCenter);
 private:
-       std::map<int,iServiceHandlerPtr> handler;
+       std::map<int,ePtr<iServiceHandler> > handler;
        static eServiceCenter *instance;
 #ifdef SWIG
        eServiceCenter();
@@ -23,19 +25,20 @@ public:
 #ifndef SWIG
        eServiceCenter();
        virtual ~eServiceCenter();
-#endif
+
                // iServiceHandler
-       RESULT play(const eServiceReference &, iPlayableServicePtr &ptr);
-       RESULT record(const eServiceReference &, iRecordableServicePtr &ptr);
-       RESULT list(const eServiceReference &, iListableServicePtr &ptr);
+       RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr);
+       RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
+       RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
        RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr);
        RESULT offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr);
        
                // eServiceCenter
-       static RESULT getPrivInstance(eServiceCenterPtr &ptr) { ptr = instance; return 0; }
-       static SWIG_VOID(RESULT) getInstance(iServiceHandlerPtr &SWIG_NAMED_OUTPUT(ptr)) { ptr = instance; return 0; }
+       static RESULT getPrivInstance(ePtr<eServiceCenter> &ptr) { ptr = instance; return 0; }
        RESULT addServiceFactory(int id, iServiceHandler *hnd);
        RESULT removeServiceFactory(int id);
+#endif
+       static SWIG_VOID(RESULT) getInstance(ePtr<iServiceHandler> &SWIG_NAMED_OUTPUT(ptr)) { ptr = instance; return 0; }
 };
 
 #endif
index 9587273a3dc1bc9f912ef4ff7f6495e1025bd6bd..2b032e6c2244ff10169862e491d0be2516779f11 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -1,5 +1,6 @@
 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
@@ -10,12 +11,11 @@ def setEPGLanguage():
        
 language.addCallback(setEPGLanguage)
 
-import traceback
+from traceback import print_exc
 import Screens.InfoBar
 from Screens.SimpleSummary import SimpleSummary
 
-import sys
-import time
+from sys import stdout, exc_info
 
 import ServiceReference
 
@@ -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 Components.config import config, ConfigText, configfile, ConfigSubsection, ConfigInteger
+from Components.config import config, configfile, ConfigText, ConfigSubsection, ConfigInteger
 InitFallbackFiles()
 eDVBDB.getInstance().reloadBouquets()
 
@@ -191,9 +191,9 @@ class Session:
                try:
                        return screen(self, *arguments, **kwargs)
                except:
-                       errstr = "Screen %s(%s, %s): %s" % (str(screen), str(arguments), str(kwargs), sys.exc_info()[0])
+                       errstr = "Screen %s(%s, %s): %s" % (str(screen), str(arguments), str(kwargs), exc_info()[0])
                        print errstr
-                       traceback.print_exc(file=sys.stdout)
+                       print_exc(file=stdout)
                        quitMainloop(5)
        
        def instantiateDialog(self, screen, *arguments, **kwargs):
@@ -214,7 +214,7 @@ class Session:
                except:
                        print 'EXCEPTION IN DIALOG INIT CODE, ABORTING:'
                        print '-'*60
-                       traceback.print_exc(file=sys.stdout)
+                       print_exc(file=stdout)
                        quitMainloop(5)
                        print '-'*60
                
@@ -493,9 +493,9 @@ def runScreenTest():
        runReactor()
        
        configfile.save()
-       
-       from Tools.DreamboxHardware import setFPWakeuptime
+
        from time import time
+       from Tools.DreamboxHardware import setFPWakeuptime
        nextRecordingTime = session.nav.RecordTimer.getNextRecordingTime()
        if nextRecordingTime != -1:
                if (nextRecordingTime - time() < 330): # no time to switch box back on
@@ -553,6 +553,6 @@ try:
 except:
        print 'EXCEPTION IN PYTHON STARTUP CODE:'
        print '-'*60
-       traceback.print_exc(file=sys.stdout)
+       print_exc(file=stdout)
        quitMainloop(5)
        print '-'*60
diff --git a/skin.py b/skin.py
index 52b55360ed61e344c284386f3b21dd2cef7a7d57..b2daa7fcd0f2bb15d1b023f41e13cd94b81eb671 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
-from Tools.Import import my_import
-import os
+from os import path
+
+from enigma import eSize, ePoint, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, \
+       loadPNG, addFont, gRGB, eWindowStyleSkinned
 
 from Components.config import ConfigSubsection, ConfigText, config
 from Components.Element import Element
 from Components.Converter.Converter import Converter
-
+from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS
+from Tools.Import import my_import
 from Tools.XMLTools import elementsWithTag, mergeText
 
 colorNames = dict()
@@ -20,8 +22,6 @@ def dump(x, i=0):
        except:
                None
 
-from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS
-
 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)
-       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
@@ -262,8 +262,7 @@ def loadSingleSkinData(desktop, dom_skin, path_prefix):
                        except:
                                raise ("Unknown color %s" % (type))
                        
-               x = eWindowStyleManagerPtr()
-               eWindowStyleManager.getInstance(x)
+               x = eWindowStyleManager.getInstance()
                x.setStyle(id, style)
 
 def loadSkinData(desktop):
index e298f665557d87e93b04ef7f7ec1d501d439fb15..5720cf9d5be638229286655bac1ddce23af7a840 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
@@ -33,15 +33,15 @@ class TimerEntry:
        def processRepeated(self):
                print "ProcessRepeated"
                if (self.repeated != 0):
-                       now = int(time.time()) + 1
+                       now = int(time()) + 1
 
                        #to avoid problems with daylight saving, we need to calculate with localtime, in struct_time representation
-                       localbegin = time.localtime(self.begin)
-                       localend = time.localtime(self.end)
-                       localnow = time.localtime(now)
+                       localbegin = localtime(self.begin)
+                       localend = localtime(self.end)
+                       localnow = localtime(now)
 
-                       print time.strftime("%c", localbegin)
-                       print time.strftime("%c", localend)
+                       print strftime("%c", localbegin)
+                       print strftime("%c", localend)
 
                        day = []
                        flags = self.repeated
@@ -53,21 +53,21 @@ class TimerEntry:
                                        day.append(1)
                                flags = flags >> 1
 
-                       print time.strftime("%c", localnow)
+                       print strftime("%c", localnow)
                        while ((day[localbegin.tm_wday] != 0) or ((day[localbegin.tm_wday] == 0) and localend < localnow)):
-                               print time.strftime("%c", localbegin)
-                               print time.strftime("%c", localend)
+                               print strftime("%c", localbegin)
+                               print strftime("%c", localend)
                                #add one day to the struct_time, we have to convert using gmt functions, because the daylight saving flag might change after we add our 86400 seconds
-                               localbegin = time.gmtime(calendar.timegm(localbegin) + 86400)
-                               localend = time.gmtime(calendar.timegm(localend) + 86400)
+                               localbegin = gmtime(timegm(localbegin) + 86400)
+                               localend = gmtime(timegm(localend) + 86400)
 
                        #we now have a struct_time representation of begin and end in localtime, but we have to calculate back to (gmt) seconds since epoch
-                       self.begin = int(time.mktime(localbegin))
-                       self.end = int(time.mktime(localend)) + 1
+                       self.begin = int(mktime(localbegin))
+                       self.end = int(mktime(localend)) + 1
 
                        print "ProcessRepeated result"
-                       print time.strftime("%c", time.localtime(self.begin))
-                       print time.strftime("%c", time.localtime(self.end))
+                       print strftime("%c", localtime(self.begin))
+                       print strftime("%c", localtime(self.end))
 
                        self.timeChanged()
 
@@ -84,10 +84,10 @@ class TimerEntry:
 
        # check if a timer entry must be skipped
        def shouldSkip(self):
-               return self.end <= time.time() and self.state == TimerEntry.StateWaiting
+               return self.end <= time() and self.state == TimerEntry.StateWaiting
 
        def abort(self):
-               self.end = time.time()
+               self.end = time()
                
                # in case timer has not yet started, but gets aborted (so it's preparing),
                # set begin to now.
@@ -124,7 +124,7 @@ class Timer:
                
                self.timer = eTimer()
                self.timer.timeout.get().append(self.calcNextActivation)
-               self.lastActivation = time.time()
+               self.lastActivation = time()
                
                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)
-                       bisect.insort(self.processed_timers, entry)
+                       insort(self.processed_timers, entry)
                        entry.state = TimerEntry.StateEnded
                else:
-                       bisect.insort(self.timer_list, entry)
+                       insort(self.timer_list, entry)
                        if not noRecalc:
                                self.calcNextActivation()
        
        def setNextActivation(self, when):
-               delay = int((when - time.time()) * 1000)
+               delay = int((when - time()) * 1000)
                print "[timer.py] next activation: %d (in %d ms)" % (when, delay)
                
                self.timer.start(delay, 1)
                self.next = when
 
        def calcNextActivation(self):
-               if self.lastActivation > time.time():
+               if self.lastActivation > time():
                        print "[timer.py] timewarp - re-evaluating all processed timers."
                        tl = self.processed_timers
                        self.processed_timers = [ ]
@@ -177,9 +177,9 @@ class Timer:
                                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):
@@ -219,7 +219,7 @@ class Timer:
                # 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:
@@ -227,13 +227,13 @@ class Timer:
                                w.state = TimerEntry.StateWaiting
                                self.addTimerEntry(w)
                        else:
-                               bisect.insort(self.processed_timers, w)
+                               insort(self.processed_timers, w)
                
                self.stateChanged(w)
 
        def processActivation(self):
-               print "It's now ", time.strftime("%c", time.localtime(time.time()))
-               t = int(time.time()) + 1
+               print "It's now ", strftime("%c", localtime(time()))
+               t = int(time()) + 1
                
                # we keep on processing the first entry until it goes into the future.
                while len(self.timer_list) and self.timer_list[0].getNextActivation() < t: