aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Navigation.py2
-rw-r--r--ServiceReference.py3
-rw-r--r--keymapparser.py3
-rw-r--r--lib/actions/action.cpp14
-rw-r--r--lib/actions/action.h11
-rw-r--r--lib/base/ebase.h5
-rw-r--r--lib/driver/etimezone.cpp3
-rw-r--r--lib/driver/etimezone.h6
-rw-r--r--lib/dvb/db.h2
-rw-r--r--lib/dvb/dvb.cpp7
-rw-r--r--lib/dvb/dvb.h21
-rw-r--r--lib/dvb/idvb.h52
-rw-r--r--lib/gdi/gpixmap.h13
-rw-r--r--lib/gui/elistboxcontent.h11
-rw-r--r--lib/gui/ewidget.h2
-rw-r--r--lib/gui/ewindowstyle.cpp7
-rw-r--r--lib/gui/ewindowstyle.h32
-rw-r--r--lib/gui/ewindowstyleskinned.h4
-rw-r--r--lib/python/Components/AVSwitch.py2
-rw-r--r--lib/python/Components/About.py2
-rw-r--r--lib/python/Components/ActionMap.py7
-rw-r--r--lib/python/Components/ChoiceList.py16
-rw-r--r--lib/python/Components/Clock.py5
-rw-r--r--lib/python/Components/ConditionalWidget.py6
-rw-r--r--lib/python/Components/EpgList.py15
-rw-r--r--lib/python/Components/FileList.py19
-rw-r--r--lib/python/Components/Harddisk.py12
-rw-r--r--lib/python/Components/Language.py3
-rw-r--r--lib/python/Components/LanguageList.py41
-rw-r--r--lib/python/Components/MediaPlayer.py17
-rw-r--r--lib/python/Components/MovieList.py9
-rw-r--r--lib/python/Components/MultiContent.py13
-rw-r--r--lib/python/Components/Network.py2
-rw-r--r--lib/python/Components/ParentalControlList.py13
-rw-r--r--lib/python/Components/PluginComponent.py18
-rw-r--r--lib/python/Components/PluginList.py4
-rw-r--r--lib/python/Components/RFmod.py6
-rw-r--r--lib/python/Components/ServiceList.py2
-rw-r--r--lib/python/Components/ServicePosition.py2
-rw-r--r--lib/python/Components/TimerList.py15
-rw-r--r--lib/python/Components/Timezones.py5
-rw-r--r--lib/python/Components/components.py1
-rw-r--r--lib/python/Makefile.am3
-rw-r--r--lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py4
-rw-r--r--lib/python/Plugins/Extensions/CutListEditor/plugin.py4
-rw-r--r--lib/python/Plugins/Extensions/FileManager/plugin.py9
-rw-r--r--lib/python/Plugins/Extensions/MediaScanner/plugin.py12
-rw-r--r--lib/python/Plugins/Extensions/PicturePlayer/plugin.py4
-rw-r--r--lib/python/Plugins/Extensions/SimpleRSS/plugin.py4
-rw-r--r--lib/python/Plugins/Extensions/TuxboxPlugins/plugin.py9
-rw-r--r--lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py25
-rw-r--r--lib/python/Plugins/SystemPlugins/OldSoftwareUpdate/plugin.py21
-rw-r--r--lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py16
-rw-r--r--lib/python/Plugins/SystemPlugins/Satfinder/plugin.py14
-rwxr-xr-xlib/python/Plugins/SystemPlugins/SkinSelector/plugin.py11
-rw-r--r--lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py19
-rw-r--r--lib/python/Screens/ChannelSelection.py2
-rw-r--r--lib/python/Screens/ChoiceBox.py4
-rw-r--r--lib/python/Screens/Ci.py2
-rw-r--r--lib/python/Screens/Dish.py2
-rw-r--r--lib/python/Screens/EpgSelection.py2
-rw-r--r--lib/python/Screens/EventView.py2
-rw-r--r--lib/python/Screens/InfoBar.py7
-rw-r--r--lib/python/Screens/InfoBarGenerics.py25
-rw-r--r--lib/python/Screens/InputBox.py7
-rw-r--r--lib/python/Screens/MediaPlayer.py1
-rw-r--r--lib/python/Screens/PVRState.py2
-rw-r--r--lib/python/Screens/ParentalControlSetup.py6
-rw-r--r--lib/python/Screens/PiPSetup.py4
-rw-r--r--lib/python/Screens/Scart.py3
-rw-r--r--lib/python/Screens/Standby.py2
-rw-r--r--lib/python/enigma_py_patcher.py43
-rw-r--r--lib/python/enigma_python.i6
-rw-r--r--lib/python/python.h2
-rw-r--r--lib/python/swig.h26
-rw-r--r--lib/service/event.h17
-rw-r--r--lib/service/iservice.h428
-rw-r--r--lib/service/service.h17
-rw-r--r--mytest.py22
-rw-r--r--skin.py19
-rw-r--r--timer.py64
81 files changed, 632 insertions, 671 deletions
diff --git a/Navigation.py b/Navigation.py
index 50cdf01f..c2d2752a 100644
--- a/Navigation.py
+++ b/Navigation.py
@@ -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
diff --git a/ServiceReference.py b/ServiceReference.py
index 9dd316f2..f7aa6397 100644
--- a/ServiceReference.py
+++ b/ServiceReference.py
@@ -1,5 +1,4 @@
-
-from enigma import *
+from enigma import eServiceReference, eServiceCenter
import NavigationInstance
diff --git a/keymapparser.py b/keymapparser.py
index 1a6a3781..f8aa07f4 100644
--- a/keymapparser.py
+++ b/keymapparser.py
@@ -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"
diff --git a/lib/actions/action.cpp b/lib/actions/action.cpp
index 56ad89a1..c1d2c191 100644
--- a/lib/actions/action.cpp
+++ b/lib/actions/action.cpp
@@ -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");
diff --git a/lib/actions/action.h b/lib/actions/action.h
index f2e0d8f4..7bd71259 100644
--- a/lib/actions/action.h
+++ b/lib/actions/action.h
@@ -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
diff --git a/lib/base/ebase.h b/lib/base/ebase.h
index db936794..75b58205 100644
--- a/lib/base/ebase.h
+++ b/lib/base/ebase.h
@@ -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;
diff --git a/lib/driver/etimezone.cpp b/lib/driver/etimezone.cpp
index 4accdba8..25879ce0 100644
--- a/lib/driver/etimezone.cpp
+++ b/lib/driver/etimezone.cpp
@@ -1,8 +1,7 @@
#include "etimezone.h"
-
#include <time.h>
-etimezone::etimezone()
+void e_tzset()
{
tzset();
}
diff --git a/lib/driver/etimezone.h b/lib/driver/etimezone.h
index 081bf139..7f1b2a80 100644
--- a/lib/driver/etimezone.h
+++ b/lib/driver/etimezone.h
@@ -1,11 +1,7 @@
#ifndef __etimezone_h
#define __etimezone_h
-class etimezone
-{
-public:
- etimezone();
-};
+void e_tzset(void);
#endif
diff --git a/lib/dvb/db.h b/lib/dvb/db.h
index 430a5af0..34ecfc14 100644
--- a/lib/dvb/db.h
+++ b/lib/dvb/db.h
@@ -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
diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp
index ecb0ec6e..ad146542 100644
--- a/lib/dvb/dvb.cpp
+++ b/lib/dvb/dvb.cpp
@@ -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)
{
diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h
index 037c1974..95d10916 100644
--- a/lib/dvb/dvb.h
+++ b/lib/dvb/dvb.h
@@ -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
diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h
index 9e78153b..a34be984 100644
--- a/lib/dvb/idvb.h
+++ b/lib/dvb/idvb.h
@@ -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;
diff --git a/lib/gdi/gpixmap.h b/lib/gdi/gpixmap.h
index d717ec6f..e3798bf7 100644
--- a/lib/gdi/gpixmap.h
+++ b/lib/gdi/gpixmap.h
@@ -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
diff --git a/lib/gui/elistboxcontent.h b/lib/gui/elistboxcontent.h
index d86d592d..9c89c658 100644
--- a/lib/gui/elistboxcontent.h
+++ b/lib/gui/elistboxcontent.h
@@ -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
diff --git a/lib/gui/ewidget.h b/lib/gui/ewidget.h
index f7c611f6..98b30087 100644
--- a/lib/gui/ewidget.h
+++ b/lib/gui/ewidget.h
@@ -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);
diff --git a/lib/gui/ewindowstyle.cpp b/lib/gui/ewindowstyle.cpp
index 2558669a..68a74e0c 100644
--- a/lib/gui/ewindowstyle.cpp
+++ b/lib/gui/ewindowstyle.cpp
@@ -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;
diff --git a/lib/gui/ewindowstyle.h b/lib/gui/ewindowstyle.h
index 4824aad6..91f2f0b7 100644
--- a/lib/gui/ewindowstyle.h
+++ b/lib/gui/ewindowstyle.h
@@ -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
diff --git a/lib/gui/ewindowstyleskinned.h b/lib/gui/ewindowstyleskinned.h
index 1c16a7b5..57c54a08 100644
--- a/lib/gui/ewindowstyleskinned.h
+++ b/lib/gui/ewindowstyleskinned.h
@@ -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,
diff --git a/lib/python/Components/AVSwitch.py b/lib/python/Components/AVSwitch.py
index 8a7bd8d1..a8e471ba 100644
--- a/lib/python/Components/AVSwitch.py
+++ b/lib/python/Components/AVSwitch.py
@@ -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) }
diff --git a/lib/python/Components/About.py b/lib/python/Components/About.py
index e5f9543e..2f3fec09 100644
--- a/lib/python/Components/About.py
+++ b/lib/python/Components/About.py
@@ -1,4 +1,4 @@
-from Tools.Directories import *
+from Tools.Directories import resolveFilename, SCOPE_SYSETC
class About:
def __init__(self):
diff --git a/lib/python/Components/ActionMap.py b/lib/python/Components/ActionMap.py
index d2e908e6..b65d6ebc 100644
--- a/lib/python/Components/ActionMap.py
+++ b/lib/python/Components/ActionMap.py
@@ -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()
diff --git a/lib/python/Components/ChoiceList.py b/lib/python/Components/ChoiceList.py
index a0fbde54..a2070c7d 100644
--- a/lib/python/Components/ChoiceList.py
+++ b/lib/python/Components/ChoiceList.py
@@ -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 ]
diff --git a/lib/python/Components/Clock.py b/lib/python/Components/Clock.py
index 95f29b16..9a6031e6 100644
--- a/lib/python/Components/Clock.py
+++ b/lib/python/Components/Clock.py
@@ -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:
diff --git a/lib/python/Components/ConditionalWidget.py b/lib/python/Components/ConditionalWidget.py
index 391b8871..7d35d956 100644
--- a/lib/python/Components/ConditionalWidget.py
+++ b/lib/python/Components/ConditionalWidget.py
@@ -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)
diff --git a/lib/python/Components/EpgList.py b/lib/python/Components/EpgList.py
index 902968d4..ca209bda 100644
--- a/lib/python/Components/EpgList.py
+++ b/lib/python/Components/EpgList.py
@@ -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
diff --git a/lib/python/Components/FileList.py b/lib/python/Components/FileList.py
index 7621ccb0..b85b8ea3 100644
--- a/lib/python/Components/FileList.py
+++ b/lib/python/Components/FileList.py
@@ -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)
diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py
index f060c37a..fee1ed74 100644
--- a/lib/python/Components/Harddisk.py
+++ b/lib/python/Components/Harddisk.py
@@ -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")]
diff --git a/lib/python/Components/Language.py b/lib/python/Components/Language.py
index 1bbf0bc0..a27f247e 100644
--- a/lib/python/Components/Language.py
+++ b/lib/python/Components/Language.py
@@ -1,7 +1,6 @@
import gettext
-import os
-from Tools.Directories import *
+from Tools.Directories import SCOPE_LANGUAGE, resolveFilename
class Language:
def __init__(self):
diff --git a/lib/python/Components/LanguageList.py b/lib/python/Components/LanguageList.py
index e625d7c7..e69de29b 100644
--- a/lib/python/Components/LanguageList.py
+++ b/lib/python/Components/LanguageList.py
@@ -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)
diff --git a/lib/python/Components/MediaPlayer.py b/lib/python/Components/MediaPlayer.py
index d88b6280..44937fa3 100644
--- a/lib/python/Components/MediaPlayer.py
+++ b/lib/python/Components/MediaPlayer.py
@@ -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
diff --git a/lib/python/Components/MovieList.py b/lib/python/Components/MovieList.py
index 1da5a519..dcd99fea 100644
--- a/lib/python/Components/MovieList.py
+++ b/lib/python/Components/MovieList.py
@@ -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):
diff --git a/lib/python/Components/MultiContent.py b/lib/python/Components/MultiContent.py
index 06ecde96..3031fb3a 100644
--- a/lib/python/Components/MultiContent.py
+++ b/lib/python/Components/MultiContent.py
@@ -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 = ()
diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py
index 5add0c01..f65863dc 100644
--- a/lib/python/Components/Network.py
+++ b/lib/python/Components/Network.py
@@ -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()
diff --git a/lib/python/Components/ParentalControlList.py b/lib/python/Components/ParentalControlList.py
index 9791e1b0..02e88002 100644
--- a/lib/python/Components/ParentalControlList.py
+++ b/lib/python/Components/ParentalControlList.py
@@ -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"))
diff --git a/lib/python/Components/PluginComponent.py b/lib/python/Components/PluginComponent.py
index 120b4636..9425e56d 100644
--- a/lib/python/Components/PluginComponent.py
+++ b/lib/python/Components/PluginComponent.py
@@ -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
diff --git a/lib/python/Components/PluginList.py b/lib/python/Components/PluginList.py
index 9b9cfea8..fd988065 100644
--- a/lib/python/Components/PluginList.py
+++ b/lib/python/Components/PluginList.py
@@ -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 ]
diff --git a/lib/python/Components/RFmod.py b/lib/python/Components/RFmod.py
index 234ae4ca..0ab4a815 100644
--- a/lib/python/Components/RFmod.py
+++ b/lib/python/Components/RFmod.py
@@ -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)
diff --git a/lib/python/Components/ServiceList.py b/lib/python/Components/ServiceList.py
index 6145adef..c2d58f2f 100644
--- a/lib/python/Components/ServiceList.py
+++ b/lib/python/Components/ServiceList.py
@@ -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
diff --git a/lib/python/Components/ServicePosition.py b/lib/python/Components/ServicePosition.py
index d34d81fb..6f7082d5 100644
--- a/lib/python/Components/ServicePosition.py
+++ b/lib/python/Components/ServicePosition.py
@@ -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):
diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py
index 2f60fcfb..d2ccbb9c 100644
--- a/lib/python/Components/TimerList.py
+++ b/lib/python/Components/TimerList.py
@@ -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> |
diff --git a/lib/python/Components/Timezones.py b/lib/python/Components/Timezones.py
index 704b765e..ccc98279 100644
--- a/lib/python/Components/Timezones.py
+++ b/lib/python/Components/Timezones.py
@@ -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 = []
diff --git a/lib/python/Components/components.py b/lib/python/Components/components.py
index 512defb5..87159bf6 100644
--- a/lib/python/Components/components.py
+++ b/lib/python/Components/components.py
@@ -1,4 +1,3 @@
-from enigma import *
import time
import sys
diff --git a/lib/python/Makefile.am b/lib/python/Makefile.am
index 1cc01544..9eb13df7 100644
--- a/lib/python/Makefile.am
+++ b/lib/python/Makefile.am
@@ -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
diff --git a/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py
index e074aeec..dae4d4ab 100644
--- a/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py
+++ b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py
@@ -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" >
diff --git a/lib/python/Plugins/Extensions/CutListEditor/plugin.py b/lib/python/Plugins/Extensions/CutListEditor/plugin.py
index 28ed7d64..ba946f98 100644
--- a/lib/python/Plugins/Extensions/CutListEditor/plugin.py
+++ b/lib/python/Plugins/Extensions/CutListEditor/plugin.py
@@ -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
diff --git a/lib/python/Plugins/Extensions/FileManager/plugin.py b/lib/python/Plugins/Extensions/FileManager/plugin.py
index d2b19719..3cbef343 100644
--- a/lib/python/Plugins/Extensions/FileManager/plugin.py
+++ b/lib/python/Plugins/Extensions/FileManager/plugin.py
@@ -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:
diff --git a/lib/python/Plugins/Extensions/MediaScanner/plugin.py b/lib/python/Plugins/Extensions/MediaScanner/plugin.py
index 5fc35ee1..71f2f1c8 100644
--- a/lib/python/Plugins/Extensions/MediaScanner/plugin.py
+++ b/lib/python/Plugins/Extensions/MediaScanner/plugin.py
@@ -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)
diff --git a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py
index 8db85ced..34e8c10f 100644
--- a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py
+++ b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py
@@ -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"))])
diff --git a/lib/python/Plugins/Extensions/SimpleRSS/plugin.py b/lib/python/Plugins/Extensions/SimpleRSS/plugin.py
index 88db4857..49da5e63 100644
--- a/lib/python/Plugins/Extensions/SimpleRSS/plugin.py
+++ b/lib/python/Plugins/Extensions/SimpleRSS/plugin.py
@@ -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
diff --git a/lib/python/Plugins/Extensions/TuxboxPlugins/plugin.py b/lib/python/Plugins/Extensions/TuxboxPlugins/plugin.py
index 8d4e1581..5142d16b 100644
--- a/lib/python/Plugins/Extensions/TuxboxPlugins/plugin.py
+++ b/lib/python/Plugins/Extensions/TuxboxPlugins/plugin.py
@@ -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":
diff --git a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py
index fae1f26d..05a2824a 100644
--- a/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py
@@ -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
diff --git a/lib/python/Plugins/SystemPlugins/OldSoftwareUpdate/plugin.py b/lib/python/Plugins/SystemPlugins/OldSoftwareUpdate/plugin.py
index 72279c1a..0f6c4e84 100644
--- a/lib/python/Plugins/SystemPlugins/OldSoftwareUpdate/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/OldSoftwareUpdate/plugin.py
@@ -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
diff --git a/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py b/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py
index 4d9e611d..db16f77f 100644
--- a/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py
@@ -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",
diff --git a/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py b/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
index 6325a82f..89fbc4bb 100644
--- a/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
@@ -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"
diff --git a/lib/python/Plugins/SystemPlugins/SkinSelector/plugin.py b/lib/python/Plugins/SystemPlugins/SkinSelector/plugin.py
index 844b75f9..18ffd994 100755
--- a/lib/python/Plugins/SystemPlugins/SkinSelector/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/SkinSelector/plugin.py
@@ -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"
diff --git a/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py b/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py
index dc494e6f..b5034b63 100644
--- a/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/SoftwareUpdate/plugin.py
@@ -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
diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py
index 0eff5967..9cbb4221 100644
--- a/lib/python/Screens/ChannelSelection.py
+++ b/lib/python/Screens/ChannelSelection.py
@@ -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
diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py
index a20983e6..37729887 100644
--- a/lib/python/Screens/ChoiceBox.py
+++ b/lib/python/Screens/ChoiceBox.py
@@ -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)
diff --git a/lib/python/Screens/Ci.py b/lib/python/Screens/Ci.py
index c3302a1c..27ca5aa3 100644
--- a/lib/python/Screens/Ci.py
+++ b/lib/python/Screens/Ci.py
@@ -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
diff --git a/lib/python/Screens/Dish.py b/lib/python/Screens/Dish.py
index bcc35807..a34f0c57 100644
--- a/lib/python/Screens/Dish.py
+++ b/lib/python/Screens/Dish.py
@@ -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):
diff --git a/lib/python/Screens/EpgSelection.py b/lib/python/Screens/EpgSelection.py
index 5d29df0d..0483f98b 100644
--- a/lib/python/Screens/EpgSelection.py
+++ b/lib/python/Screens/EpgSelection.py
@@ -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
diff --git a/lib/python/Screens/EventView.py b/lib/python/Screens/EventView.py
index 82bca9fd..8504165d 100644
--- a/lib/python/Screens/EventView.py
+++ b/lib/python/Screens/EventView.py
@@ -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
diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py
index f1123842..24c2b40b 100644
--- a/lib/python/Screens/InfoBar.py
+++ b/lib/python/Screens/InfoBar.py
@@ -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,
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 26bc0d41..646419c3 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -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):
diff --git a/lib/python/Screens/InputBox.py b/lib/python/Screens/InputBox.py
index bb8b63d9..6cdb42ee 100644
--- a/lib/python/Screens/InputBox.py
+++ b/lib/python/Screens/InputBox.py
@@ -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()))
diff --git a/lib/python/Screens/MediaPlayer.py b/lib/python/Screens/MediaPlayer.py
index 1411b427..4e299b27 100644
--- a/lib/python/Screens/MediaPlayer.py
+++ b/lib/python/Screens/MediaPlayer.py
@@ -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
diff --git a/lib/python/Screens/PVRState.py b/lib/python/Screens/PVRState.py
index b2c8a4d9..f7b2abf7 100644
--- a/lib/python/Screens/PVRState.py
+++ b/lib/python/Screens/PVRState.py
@@ -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)
diff --git a/lib/python/Screens/ParentalControlSetup.py b/lib/python/Screens/ParentalControlSetup.py
index 7c4c3ecf..045e8fb7 100644
--- a/lib/python/Screens/ParentalControlSetup.py
+++ b/lib/python/Screens/ParentalControlSetup.py
@@ -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)
diff --git a/lib/python/Screens/PiPSetup.py b/lib/python/Screens/PiPSetup.py
index af313930..67c5b84b 100644
--- a/lib/python/Screens/PiPSetup.py
+++ b/lib/python/Screens/PiPSetup.py
@@ -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
diff --git a/lib/python/Screens/Scart.py b/lib/python/Screens/Scart.py
index 329300a1..dc511448 100644
--- a/lib/python/Screens/Scart.py
+++ b/lib/python/Screens/Scart.py
@@ -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)
diff --git a/lib/python/Screens/Standby.py b/lib/python/Screens/Standby.py
index 9e3ade45..064171f1 100644
--- a/lib/python/Screens/Standby.py
+++ b/lib/python/Screens/Standby.py
@@ -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
index 00000000..52f9d232
--- /dev/null
+++ b/lib/python/enigma_py_patcher.py
@@ -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")
diff --git a/lib/python/enigma_python.i b/lib/python/enigma_python.i
index 92484735..090585bd 100644
--- a/lib/python/enigma_python.i
+++ b/lib/python/enigma_python.i
@@ -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
diff --git a/lib/python/python.h b/lib/python/python.h
index d0fe92a8..76d2d197 100644
--- a/lib/python/python.h
+++ b/lib/python/python.h
@@ -157,7 +157,7 @@ public:
TestObj();
~TestObj();
};
-TEMPLATE_TYPEDEF(ePtr<TestObj>, TestObjPtr);
+SWIG_TEMPLATE_TYPEDEF(ePtr<TestObj>, TestObjPtr);
#ifndef SWIG
extern PyObject *New_TestObj();
diff --git a/lib/python/swig.h b/lib/python/swig.h
index c094b646..da787eea 100644
--- a/lib/python/swig.h
+++ b/lib/python/swig.h
@@ -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
diff --git a/lib/service/event.h b/lib/service/event.h
index 25b9d0b7..d1e1d08b 100644
--- a/lib/service/event.h
+++ b/lib/service/event.h
@@ -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
diff --git a/lib/service/iservice.h b/lib/service/iservice.h
index c809e813..98ece76e 100644
--- a/lib/service/iservice.h
+++ b/lib/service/iservice.h
@@ -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
diff --git a/lib/service/service.h b/lib/service/service.h
index 813da24c..77173c53 100644
--- a/lib/service/service.h
+++ b/lib/service/service.h
@@ -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
diff --git a/mytest.py b/mytest.py
index 9587273a..2b032e6c 100644
--- 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 52b55360..b2daa7fc 100644
--- 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):
diff --git a/timer.py b/timer.py
index e298f665..5720cf9d 100644
--- 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: