aboutsummaryrefslogtreecommitdiff
path: root/xbmc/filesystem/PluginDirectory.cpp
diff options
context:
space:
mode:
authorJim Carroll <thecarrolls@jiminger.com>2011-04-14 10:10:03 -0400
committerJim Carroll <thecarrolls@jiminger.com>2011-04-14 10:10:03 -0400
commit17ad70e095c1a57c39fd7c85a082940f79f75397 (patch)
tree9e095da7fec21659e19256be4596a74879da549b /xbmc/filesystem/PluginDirectory.cpp
parent492687b4cdf0994dbe02241fa3d86fb5fcf381a6 (diff)
parent66683a8f2f221c2705b24375f9da7d54503b38c5 (diff)
Merge remote branch 'jcarroll/default-addon-id'
* jcarroll/default-addon-id: Removed modest attempt to introduce an industry standard to coding naming conventions. :) This applies elupus' os.getcwd override but only for scripts that are dependent on the xbmc.python version 1.0 (or less) interface. Cleanup the potential memory leak when the Addon constructor fails. The Addon constructor will now check the version of the xbmc python api that the script is dependent upon and will only apply the backward compatibility hack if the version is 1.0 or less. Otherwise it will assume the script has been updated for eden and will not try to get the id from the addon.xml file as a recovery from a failed Addon instantiation. This will allow scripts to run in a backward compatible way without requiring modifications to the core python behavior. Added the ability for a python script to instantiate an Addon instance without the need to pass an addon id. The default behavior is now to obtain the addon id from the Addon::ID method which is passed through python via the global dictionary. The ability to provide an id still exists if the Addon being instantiated is different from the one that's running.
Diffstat (limited to 'xbmc/filesystem/PluginDirectory.cpp')
-rw-r--r--xbmc/filesystem/PluginDirectory.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/xbmc/filesystem/PluginDirectory.cpp b/xbmc/filesystem/PluginDirectory.cpp
index 0dd8d2e7fc..53e025e0ae 100644
--- a/xbmc/filesystem/PluginDirectory.cpp
+++ b/xbmc/filesystem/PluginDirectory.cpp
@@ -117,7 +117,7 @@ bool CPluginDirectory::StartScript(const CStdString& strPath, bool retrievingDir
bool success = false;
#ifdef HAS_PYTHON
CStdString file = m_addon->LibPath();
- if (g_pythonParser.evalFile(file, argv) >= 0)
+ if (g_pythonParser.evalFile(file, argv,m_addon) >= 0)
{ // wait for our script to finish
CStdString scriptName = m_addon->Name();
success = WaitOnScriptResult(file, scriptName, retrievingDir);
@@ -434,7 +434,7 @@ bool CPluginDirectory::RunScriptWithParams(const CStdString& strPath)
// run the script
#ifdef HAS_PYTHON
CLog::Log(LOGDEBUG, "%s - calling plugin %s('%s','%s','%s')", __FUNCTION__, addon->Name().c_str(), argv[0].c_str(), argv[1].c_str(), argv[2].c_str());
- if (g_pythonParser.evalFile(addon->LibPath(), argv) >= 0)
+ if (g_pythonParser.evalFile(addon->LibPath(), argv,addon) >= 0)
return true;
else
#endif