aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Screens/Standby.py18
-rw-r--r--lib/python/python.h36
2 files changed, 43 insertions, 11 deletions
diff --git a/lib/python/Screens/Standby.py b/lib/python/Screens/Standby.py
index b8ccb6c2..c598b545 100644
--- a/lib/python/Screens/Standby.py
+++ b/lib/python/Screens/Standby.py
@@ -65,28 +65,26 @@ class Standby(Screen):
self.avswitch.setInput("AUX")
#set lcd brightness to standby value
config.lcd.standby.apply()
- self.onShow.append(self.__onShow)
- self.onHide.append(self.__onHide)
+ self.onFirstExecBegin.append(self.__onFirstExecBegin)
self.onClose.append(self.__onClose)
def __onClose(self):
+ global inStandby
+ inStandby = None
if self.prev_running_service:
self.session.nav.playService(self.prev_running_service)
elif self.paused_service:
self.paused_service.unPauseService()
+ self.session.screen["Standby"].boolean = False
- def createSummary(self):
- return StandbySummary
-
- def __onShow(self):
+ def __onFirstExecBegin(self):
global inStandby
inStandby = self
self.session.screen["Standby"].boolean = True
+ config.misc.standbyCounter.value += 1
- def __onHide(self):
- global inStandby
- inStandby = None
- self.session.screen["Standby"].boolean = False
+ def createSummary(self):
+ return StandbySummary
class StandbySummary(Screen):
skin = """
diff --git a/lib/python/python.h b/lib/python/python.h
index 52ec6c1e..18fdac78 100644
--- a/lib/python/python.h
+++ b/lib/python/python.h
@@ -155,6 +155,41 @@ inline void ePyObject::decref()
Py_DECREF(m_ob);
}
+class ePyObjectWrapper
+{
+ ePyObject m_obj;
+public:
+ ePyObjectWrapper(const ePyObjectWrapper &wrapper)
+ :m_obj(wrapper.m_obj)
+ {
+ Py_INCREF(m_obj);
+ }
+ ePyObjectWrapper(const ePyObject &obj)
+ :m_obj(obj)
+ {
+ Py_INCREF(m_obj);
+ }
+ ~ePyObjectWrapper()
+ {
+ Py_DECREF(m_obj);
+ }
+ ePyObjectWrapper &operator=(const ePyObjectWrapper &wrapper)
+ {
+ Py_DECREF(m_obj);
+ m_obj = wrapper.m_obj;
+ Py_INCREF(m_obj);
+ return *this;
+ }
+ operator PyObject*()
+ {
+ return m_obj;
+ }
+ operator ePyObject()
+ {
+ return m_obj;
+ }
+};
+
#endif // ! PYTHON_REFCOUNT_DEBUG
#endif // !SWIG && !SKIP_PART1
@@ -390,5 +425,4 @@ private:
#endif // SWIG
#endif // SKIP_PART2
-
#endif // __lib_python_python_class_h