aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramet <amet.nospam@gmail.com>2011-07-01 22:24:43 +0400
committeramet <amet.nospam@gmail.com>2011-07-02 10:50:07 +0400
commit6991789a70b4d1ff1969c92a0fad7267fa0d32ac (patch)
tree4bba6108d51e302570ece7a2bf6e6d73152b2cf9
parent9b5b53a102ce84b779144cdc113b87064175d303 (diff)
remove duplicate code in xbmcmodule.cpp for xbmc.output() and warn that it will be depreciated soon
-rw-r--r--xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp59
1 files changed, 12 insertions, 47 deletions
diff --git a/xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp b/xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp
index 1047fdb989..dbbcdf635d 100644
--- a/xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp
+++ b/xbmc/interfaces/python/xbmcmodule/xbmcmodule.cpp
@@ -52,6 +52,7 @@
#include "guilib/LocalizeStrings.h"
#include "utils/FileUtils.h"
#include "pythreadstate.h"
+#include "utils/log.h"
// include for constants
#include "pyutil.h"
@@ -75,53 +76,6 @@ namespace PYXBMC
* start of xbmc methods
*****************************************************************/
- // output() method
- PyDoc_STRVAR(output__doc__,
- "output(msg[, level]) -- Write a string to XBMC's log file and the debug window.\n"
- "\n"
- "msg : string - text to output.\n"
- "level : [opt] integer - log level to ouput at. (default=LOGNOTICE)\n"
- "\n"
- "*Note, You can use the above as keywords for arguments and skip certain optional arguments.\n"
- " Once you use a keyword, all following arguments require the keyword.\n"
- "\n"
- " Text is written to the log for the following conditions.\n"
- " XBMC loglevel == -1 (NONE, nothing at all is logged)"
- " XBMC loglevel == 0 (NORMAL, shows LOGNOTICE, LOGERROR, LOGSEVERE and LOGFATAL)"
- " XBMC loglevel == 1 (DEBUG, shows all)"
- " See pydocs for valid values for level.\n"
- "\n"
- "example:\n"
- " - xbmc.output(msg='This is a test string.', level=xbmc.LOGDEBUG)\n");
-
- PyObject* XBMC_Output(PyObject *self, PyObject *args, PyObject *kwds)
- {
- static const char *keywords[] = {
- "msg",
- "level",
- NULL};
-
- char *s_line = NULL;
- int iLevel = LOGNOTICE;
- if (!PyArg_ParseTupleAndKeywords(
- args,
- kwds,
- (char*)"s|i",
- (char**)keywords,
- &s_line,
- &iLevel))
- {
- return NULL;
- }
- // check for a valid loglevel
- if (iLevel < LOGDEBUG || iLevel > LOGNONE)
- iLevel = LOGNOTICE;
- CLog::Log(iLevel, "%s", s_line);
-
- Py_INCREF(Py_None);
- return Py_None;
- }
-
// log() method
PyDoc_STRVAR(log__doc__,
"log(msg[, level]) -- Write a string to XBMC's log file.\n"
@@ -170,6 +124,17 @@ namespace PYXBMC
return Py_None;
}
+ // output() method
+ PyDoc_STRVAR(output__doc__,
+ "'xbmc.output()' is depreciated and will be removed in future releases,\n"
+ "please use 'xbmc.log()' instead");
+
+ PyObject* XBMC_Output(PyObject *self, PyObject *args, PyObject *kwds)
+ {
+ CLog::Log(LOGWARNING,"'xbmc.output()' is depreciated and will be removed in future releases, please use 'xbmc.log()' instead");
+ return XBMC_Log(self, args, kwds);
+ }
+
// shutdown() method
PyDoc_STRVAR(shutdown__doc__,
"shutdown() -- Shutdown the xbox.\n"