Pre-compile mytest.py
authorMike Looijmans <milo-software@users.sourceforge.net>
Sat, 27 Aug 2011 11:53:32 +0000 (13:53 +0200)
committerMike Looijmans <milo-software@users.sourceforge.net>
Sat, 27 Aug 2011 11:53:32 +0000 (13:53 +0200)
The startup script is run in plain text through the interpreter. So
use a tiny main.py to start the image (I'm so brave to start something
else) and then import the precompiled mytest.pyo.

Makefile.am
main.py [new file with mode: 0644]
main/enigma.cpp
mytest.py

index cae7114..0ee225f 100755 (executable)
@@ -5,7 +5,7 @@ ACLOCAL_AMFLAGS = -I m4
 installdir = $(pkglibdir)/python
 install_PYTHON = \
        Navigation.py NavigationInstance.py RecordTimer.py SleepTimer.py ServiceReference.py \
-       keyids.py keymapparser.py mytest.py skin.py timer.py GlobalActions.py \
+       keyids.py keymapparser.py main.py mytest.py skin.py timer.py GlobalActions.py \
        e2reactor.py
 
 pkgconfigdir = $(libdir)/pkgconfig
diff --git a/main.py b/main.py
new file mode 100644 (file)
index 0000000..3411cd5
--- /dev/null
+++ b/main.py
@@ -0,0 +1,5 @@
+import sys, os
+if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"):
+       sys.path.append("/usr/lib/enigma2/python/enigma.zip")
+import mytest
+
index 1cdd867..99f23e4 100644 (file)
@@ -235,7 +235,7 @@ int main(int argc, char **argv)
        setIoPrio(IOPRIO_CLASS_BE, 3);
 
 //     python.execute("mytest", "__main__");
-       python.execFile(eEnv::resolve("${libdir}/enigma2/python/mytest.py").c_str());
+       python.execFile(eEnv::resolve("${libdir}/enigma2/python/main.py").c_str());
 
        extern void setFullsize(); // definend in lib/gui/evideo.cpp
        setFullsize();
index 924fd51..07dd96a 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -1,7 +1,4 @@
 import sys, os
-if os.path.isfile("/usr/lib/enigma2/python/enigma.zip"):
-       sys.path.append("/usr/lib/enigma2/python/enigma.zip")
-
 from Tools.Profile import profile, profile_final
 profile("PYTHON_START")