Permalink
Browse files

Tweaks to RemoteCall

  • Loading branch information...
1 parent 2145148 commit 10844dfa4b5c545fc367a96be10c856809aa54b5 @kg committed Jan 3, 2011
Showing with 21 additions and 6 deletions.
  1. +6 −4 Common/Common.cs
  2. +14 −0 Common/common.py
  3. +1 −2 Common/common.sql.py
View
@@ -263,9 +263,11 @@ public Common (ScriptName name)
functionArguments[i + 1] = rawArguments[i];
}
- IManagedScript instance = Program.GetScriptInstance(
- new ScriptName(scriptName)
- );
+ ScriptName sn;
+ if (!Program.PythonModuleToScript.TryGetValue(scriptName, out sn))
+ sn = new ScriptName(scriptName);
+
+ IManagedScript instance = Program.GetScriptInstance(sn);
if (instance == null) {
LogPrint(process,
@@ -393,7 +395,7 @@ public Common (ScriptName name)
var rows = new List<Dictionary<string, object>>();
using (var q = Program.Database.BuildQuery(sql)) {
- var fReader = q.ExecuteReader();
+ var fReader = q.ExecuteReader(arguments);
yield return fReader;
using (fReader.Result) {
View
@@ -148,6 +148,20 @@ def playSound(filename):
remoteCall("Common.Script.dll", "PlaySound", moduleName, filename)
+def getPreference(name, moduleName=None):
+ if moduleName is None:
+ moduleName = getCallingModule()
+ moduleName = moduleName.replace("shootblues.", "")
+
+ return remoteCall(moduleName, "GetPreference", name)
+
+def setPreference(name, value, moduleName=None):
+ if moduleName is None:
+ moduleName = getCallingModule()
+ moduleName = moduleName.replace("shootblues.", "")
+
+ return remoteCall(moduleName, "SetPreference", name, value)
+
def showBalloonTip(title, text, timeout=None):
if timeout:
args = [timeout, title, text]
@@ -4,5 +4,4 @@ def createTable(name, tableDef):
return remoteCall("Common.Script.dll", "CreateDBTable", name, tableDef)
def query(sql, *args):
- return remoteCall("Common.Script.dll", "ExecuteSQL", sql, *args)
-
+ return remoteCall("Common.Script.dll", "ExecuteSQL", sql, *args)

0 comments on commit 10844df

Please sign in to comment.