1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-15 18:58:55 +01:00

Rename script to __script__

This commit is contained in:
David Sansome 2011-05-30 14:53:28 +00:00
parent 143308d2d2
commit fb25a3d4f4
3 changed files with 4 additions and 4 deletions

View File

@ -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:

View File

@ -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());

View File

@ -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) {