git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove no longer needed enigma2_rel25.pot file
[enigma2.git]
/
lib
/
python
/
python.h
diff --git
a/lib/python/python.h
b/lib/python/python.h
index 9edc50ada9dec481dd22967db3d501b2f5c0e400..18fdac78fe2def9040669138cc60020cce9ca3c2 100644
(file)
--- a/
lib/python/python.h
+++ b/
lib/python/python.h
@@
-24,6
+24,7
@@
public:
#ifdef PYTHON_REFCOUNT_DEBUG
inline ePyObject(PyObject *ob, const char *file, int line);
#endif
#ifdef PYTHON_REFCOUNT_DEBUG
inline ePyObject(PyObject *ob, const char *file, int line);
#endif
+ inline ePyObject(PyVarObject *ob);
inline ePyObject(PyDictObject *ob);
inline ePyObject(PyTupleObject *ob);
inline ePyObject(PyListObject *ob);
inline ePyObject(PyDictObject *ob);
inline ePyObject(PyTupleObject *ob);
inline ePyObject(PyListObject *ob);
@@
-32,11
+33,13
@@
public:
operator bool() { return !!m_ob; }
ePyObject &operator=(const ePyObject &);
ePyObject &operator=(PyObject *);
operator bool() { return !!m_ob; }
ePyObject &operator=(const ePyObject &);
ePyObject &operator=(PyObject *);
+ ePyObject &operator=(PyVarObject *ob) { return operator=((PyObject*)ob); }
ePyObject &operator=(PyDictObject *ob) { return operator=((PyObject*)ob); }
ePyObject &operator=(PyTupleObject *ob) { return operator=((PyObject*)ob); }
ePyObject &operator=(PyListObject *ob) { return operator=((PyObject*)ob); }
ePyObject &operator=(PyStringObject *ob) { return operator=((PyObject*)ob); }
operator PyObject*();
ePyObject &operator=(PyDictObject *ob) { return operator=((PyObject*)ob); }
ePyObject &operator=(PyTupleObject *ob) { return operator=((PyObject*)ob); }
ePyObject &operator=(PyListObject *ob) { return operator=((PyObject*)ob); }
ePyObject &operator=(PyStringObject *ob) { return operator=((PyObject*)ob); }
operator PyObject*();
+ operator PyVarObject*() { return (PyVarObject*)operator PyVarObject*(); }
operator PyTupleObject*() { return (PyTupleObject*)operator PyObject*(); }
operator PyListObject*() { return (PyListObject*)operator PyObject*(); }
operator PyStringObject*() { return (PyStringObject*)operator PyObject*(); }
operator PyTupleObject*() { return (PyTupleObject*)operator PyObject*(); }
operator PyListObject*() { return (PyListObject*)operator PyObject*(); }
operator PyStringObject*() { return (PyStringObject*)operator PyObject*(); }
@@
-84,6
+87,14
@@
inline ePyObject::ePyObject(PyObject *ob, const char* file, int line)
}
#endif
}
#endif
+inline ePyObject::ePyObject(PyVarObject *ob)
+ :m_ob((PyObject*)ob)
+#ifdef PYTHON_REFCOUNT_DEBUG
+ ,m_file(0), m_line(0), m_from(0), m_to(0), m_erased(false)
+#endif
+{
+}
+
inline ePyObject::ePyObject(PyDictObject *ob)
:m_ob((PyObject*)ob)
#ifdef PYTHON_REFCOUNT_DEBUG
inline ePyObject::ePyObject(PyDictObject *ob)
:m_ob((PyObject*)ob)
#ifdef PYTHON_REFCOUNT_DEBUG
@@
-144,6
+155,41
@@
inline void ePyObject::decref()
Py_DECREF(m_ob);
}
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
#endif // ! PYTHON_REFCOUNT_DEBUG
#endif // !SWIG && !SKIP_PART1
@@
-370,6
+416,7
@@
class ePython
public:
ePython();
~ePython();
public:
ePython();
~ePython();
+ int execFile(const char *file);
int execute(const std::string &pythonfile, const std::string &funcname);
static int call(ePyObject pFunc, ePyObject args);
static ePyObject resolve(const std::string &pythonfile, const std::string &funcname);
int execute(const std::string &pythonfile, const std::string &funcname);
static int call(ePyObject pFunc, ePyObject args);
static ePyObject resolve(const std::string &pythonfile, const std::string &funcname);
@@
-378,5
+425,4
@@
private:
#endif // SWIG
#endif // SKIP_PART2
#endif // SWIG
#endif // SKIP_PART2
-
#endif // __lib_python_python_class_h
#endif // __lib_python_python_class_h