diff --git a/scripts/digitallyimported-radio/main.py b/scripts/digitallyimported-radio/main.py index 22bfdb592..0abe1589b 100644 --- a/scripts/digitallyimported-radio/main.py +++ b/scripts/digitallyimported-radio/main.py @@ -15,7 +15,7 @@ class Plugin: clementine.radio_model.AddService(self.sky_service) # Register for when the user clicks the Settings button - script.connect("SettingsDialogRequested()", self.ShowSettings) + __script__.connect("SettingsDialogRequested()", self.ShowSettings) def ShowSettings(self): if not self.settings_dialog: diff --git a/src/scripting/python/pythonscript.cpp b/src/scripting/python/pythonscript.cpp index 98776ad82..053ccea17 100644 --- a/src/scripting/python/pythonscript.cpp +++ b/src/scripting/python/pythonscript.cpp @@ -53,7 +53,7 @@ bool PythonScript::Init() { module_.addVariable("__file__", info().script_file()); // Set script object - module_.addObject("script", interface()); + module_.addObject("__script__", interface()); // Eval the script PythonQtObjectPtr code = python_qt->parseFile(info().script_file()); diff --git a/tests/python_test.cpp b/tests/python_test.cpp index 0dc17d489..5d1ec604a 100644 --- a/tests/python_test.cpp +++ b/tests/python_test.cpp @@ -139,7 +139,7 @@ TEST_F(PythonTest, ModuleConstants) { "print __name__\n" "print __package__\n" "print __path__\n" - "print script\n"); + "print __script__\n"); ScriptInfo info; info.InitFromDirectory(sManager, script.directory_); @@ -153,7 +153,7 @@ TEST_F(PythonTest, ModuleConstants) { EXPECT_TRUE(log.at(n-4).endsWith("clementinescripts." + info.id())); // __name__ EXPECT_TRUE(log.at(n-3).endsWith("None")); // __package__ EXPECT_TRUE(log.at(n-2).endsWith("['" + script.directory_ + "']")); // __path__ - EXPECT_TRUE(log.at(n-1).contains("ScriptInterface (QObject ")); // script + EXPECT_TRUE(log.at(n-1).contains("ScriptInterface (QObject ")); // __script__ } TEST_F(PythonTest, PythonQtAttrSetWrappedCPP) {