Ejemplo n.º 1
0
 void Run(string[] args)
 {
     //TestMode();
     //return;
     Console.OutputEncoding = Encoding.ASCII;
     var cmd = new CmdLineHelper();
     _runner = new PyRunner(cmd.ParamAfterSwitch("command"),
         cmd.ParamAfterSwitch("script"),
         cmd.ParamAfterSwitch("args"),
         cmd.ParamAfterSwitch("workingDirectory"), cmd);
     _runner.Run();
     //Console.ReadKey();
 }
Ejemplo n.º 2
0
        void TestMode()
        {
            //  -script "TestScript.py" -args "status" -command "hg" -workingDirectory "d:\Dev\Openbox\Change Controls\GBS Reforecasts Integration"

            Console.OutputEncoding = Encoding.ASCII;
            var cmd = new CmdLineHelper();

            _runner = new PyRunner("notepad.exe",
                "TestScript.py",
                "test.txt",
                @"c:\temp", cmd);
            _runner.Run();
               // Console.ReadKey();
        }
Ejemplo n.º 3
0
        public Form1()
        {
            InitializeComponent();
            FormClosing += new FormClosingEventHandler(Form1_FormClosing);
            _configuration = new BindingList<IPConfiguration>();

            _configuration.Clear();
            foreach (var s in Properties.Settings.Default.ConfigurationStrings )
            {
                var cmd = new CmdLineHelper();
                cmd.ParseString(s);
                var config = new IPConfiguration();
                config.Configure(cmd);
                _configuration.Add(config);
            }
            UpdateContextMenu();
        }
Ejemplo n.º 4
0
 private void GetParams(IEnumerable<string> args)
 {
     _cmd = new CmdLineHelper();
     _cmd.Parse(args);
     _processName = _cmd.ParamAfterSwitch("ProcessName");
     _scriptFile = _cmd.ParamAfterSwitch("ScriptFile");
     _code = _cmd.ParamAfterSwitch("Code");
 }
Ejemplo n.º 5
0
 public PyProcessContext CreateSpawnedProcess(string command,
     string commandArguments,
     string workingDirectory,
     dynamic processHandler)
 {
     if (workingDirectory == null)
     {
         workingDirectory = _workingDirectory;
     }
     var cmd = new CmdLineHelper();
     cmd.ParseString(commandArguments);
     return new PyProcessContext(_scriptContext,
         processHandler,
         this._processFactory,
         command,
         commandArguments,
         workingDirectory,
         cmd);
 }