From cadc114a5184a0ed7ae89733bc58394a7e33a863 Mon Sep 17 00:00:00 2001 From: Sudarshan Sathe Date: Wed, 3 Jul 2019 23:27:46 +0530 Subject: [PATCH] update plugin core version + added label & file attribute --- .../Ginger.PluginPackage.Actions.json | 42 ------------------- .../Ginger.PluginPackage.json | 2 +- .../GingerPythonPluginConsole.csproj | 7 +--- .../GingerPythonService.cs | 17 ++++++-- .../PublishProfiles/FolderProfile.pubxml | 4 +- .../PublishProfiles/FolderProfile.pubxml | 2 +- GingerPythonPluginTest/UnitTest1.cs | 2 +- 7 files changed, 21 insertions(+), 55 deletions(-) delete mode 100644 GingerPythonPluginConsole/Ginger.PluginPackage.Actions.json diff --git a/GingerPythonPluginConsole/Ginger.PluginPackage.Actions.json b/GingerPythonPluginConsole/Ginger.PluginPackage.Actions.json deleted file mode 100644 index 81bf326..0000000 --- a/GingerPythonPluginConsole/Ginger.PluginPackage.Actions.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "InputValues": [ - { - "Param": "GA", - "ParamTypeName": "IGingerAction" - }, - { - "Param": "scriptContent", - "ParamTypeName": "string" - }, - { - "Param": "args", - "ParamTypeName": "List{Properties=value:String}" - } - ], - "ActionId": "RunScript", - "PluginId": "GingerPython", - "ServiceId": "Python", - "Description": "Run Script" - }, - { - "InputValues": [ - { - "Param": "GA", - "ParamTypeName": "IGingerAction" - }, - { - "Param": "scriptFileName", - "ParamTypeName": "string" - }, - { - "Param": "args", - "ParamTypeName": "List{Properties=value:String}" - } - ], - "ActionId": "RunScriptFile", - "PluginId": "GingerPython", - "ServiceId": "Python", - "Description": "Run Script file" - } -] \ No newline at end of file diff --git a/GingerPythonPluginConsole/Ginger.PluginPackage.json b/GingerPythonPluginConsole/Ginger.PluginPackage.json index 76b49ba..d38dd08 100644 --- a/GingerPythonPluginConsole/Ginger.PluginPackage.json +++ b/GingerPythonPluginConsole/Ginger.PluginPackage.json @@ -1,6 +1,6 @@ { "Id": "Python", - "Version": "v1.1.0", + "Version": "v1.2", "ProjectUrl": "https://github.com/Ginger-Automation/Ginger-Python-Plugin", "Description": "Execute Python script", "Summary": "Python...", diff --git a/GingerPythonPluginConsole/GingerPythonPluginConsole.csproj b/GingerPythonPluginConsole/GingerPythonPluginConsole.csproj index 633fec7..fd21c10 100644 --- a/GingerPythonPluginConsole/GingerPythonPluginConsole.csproj +++ b/GingerPythonPluginConsole/GingerPythonPluginConsole.csproj @@ -11,8 +11,8 @@ - - + + @@ -22,9 +22,6 @@ - - Always - Always diff --git a/GingerPythonPluginConsole/GingerPythonService.cs b/GingerPythonPluginConsole/GingerPythonService.cs index a87a273..14f98e2 100644 --- a/GingerPythonPluginConsole/GingerPythonService.cs +++ b/GingerPythonPluginConsole/GingerPythonService.cs @@ -11,11 +11,14 @@ namespace GingerPythonPlugin public class GingerPythonService { - + [GingerAction("RunScript", "Run Script")] - public void RunScript(IGingerAction GA, string scriptContent,List args=null) - { + public void RunScript(IGingerAction GA, + string scriptContent, + [Label("Python Parameters")] + List args) + { Console.WriteLine("start RunPythonScript"); PythonProcess p = PythonProcess.Builder(); @@ -40,7 +43,13 @@ public void RunScript(IGingerAction GA, string scriptContent,List args=null } [GingerAction("RunScriptFile", "Run Script file")] - public void RunScriptFile(IGingerAction GA, string scriptFileName, List args=null) + public void RunScriptFile(IGingerAction GA, + [Browse(true)] + [BrowseType(BrowseType =BrowseTypeAttribute.eBrowseType.File)] + [FileType(".py")] + string scriptFileName, + [Label("Python Parameters")] + List args) { Console.WriteLine("start RunPythonScript"); diff --git a/GingerPythonPluginConsole/Properties/PublishProfiles/FolderProfile.pubxml b/GingerPythonPluginConsole/Properties/PublishProfiles/FolderProfile.pubxml index 248bd39..36f0f2d 100644 --- a/GingerPythonPluginConsole/Properties/PublishProfiles/FolderProfile.pubxml +++ b/GingerPythonPluginConsole/Properties/PublishProfiles/FolderProfile.pubxml @@ -8,6 +8,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU netcoreapp2.1 - bin\Debug\netcoreapp2.1\publish\ + C:\Work\Python\Publish + false + <_IsPortable>true \ No newline at end of file diff --git a/GingerPythonPluginTest/Properties/PublishProfiles/FolderProfile.pubxml b/GingerPythonPluginTest/Properties/PublishProfiles/FolderProfile.pubxml index ee5cc98..36f0f2d 100644 --- a/GingerPythonPluginTest/Properties/PublishProfiles/FolderProfile.pubxml +++ b/GingerPythonPluginTest/Properties/PublishProfiles/FolderProfile.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU netcoreapp2.1 - bin\Debug\netcoreapp2.1\publish\ + C:\Work\Python\Publish false <_IsPortable>true diff --git a/GingerPythonPluginTest/UnitTest1.cs b/GingerPythonPluginTest/UnitTest1.cs index 7e90650..ede67b4 100644 --- a/GingerPythonPluginTest/UnitTest1.cs +++ b/GingerPythonPluginTest/UnitTest1.cs @@ -30,7 +30,7 @@ public void RunScript1() sum=a+b print('sum=' + str(sum))"; //Act - service.RunScript(GA, script1); + service.RunScript(GA, script1, null); //Assert