コード例 #1
0
 def pyexec(self, argv):
     """pyexec [<snippet>]
 Execute some arbitrary Python code on the agent. """
     text = " ".join(argv[1:])
     if not text:
         text = cliutils.get_text("py> ")
     if text:
         return self._obj.pyexec(text)
コード例 #2
0
ファイル: RemoteCLI.py プロジェクト: bharathi26/pycopia
 def pyexec(self, argv):
     """pyexec [<snippet>]
 Execute some arbitrary Python code on the agent. """
     text = " ".join(argv[1:])
     if not text:
         text = cliutils.get_text("py> ")
     if text:
         return self._obj.pyexec(text)
コード例 #3
0
ファイル: testrunner.py プロジェクト: animeshinvinci/pycopia
 def get_note(self):
     note = self._config.get("NOTE")
     if note:
         return note
     elif not self._config.flags.get("NONOTE"):
         from pycopia import cliutils
         return cliutils.get_text("> ", "Enter a small note to describe the test conditions. End with single '.'.")
     else:
         return None
コード例 #4
0
 def script(self, argv):
     """script [-f <filename>] [<text>]
 Run a script on the server."""
     fname = None
     opts, longopts, args = self.getopt(argv, "f:")
     for opt, arg in opts:
         if opt == "-f":
             fname = arg
     if fname:
         text = open(fname, "rb").read()
         return self._runscript(text)
     else:
         text = " ".join(args)
         if text:
             return self._runscript(text)
         else:
             text = cliutils.get_text("script> ")
             if text:
                 return self._runscript(text)
             else:
                 self._print(self.script.__doc__)
                 return
コード例 #5
0
ファイル: RemoteCLI.py プロジェクト: bharathi26/pycopia
 def script(self, argv):
     """script [-f <filename>] [<text>]
 Run a script on the server."""
     fname = None
     opts, longopts, args = self.getopt(argv, "f:")
     for opt, arg in opts:
         if opt == "-f":
             fname = arg
     if fname:
         text = open(fname).read()
         return self._runscript(text)
     else:
         text = " ".join(args)
         if text:
             return self._runscript(text)
         else:
             text = cliutils.get_text("script> ")
             if text:
                 return self._runscript(text)
             else:
                 self._print(self.script.__doc__)
                 return
コード例 #6
0
ファイル: UI.py プロジェクト: bharathi26/pycopia
 def get_text(self, msg=None):
     return cliutils.get_text(self._get_prompt("PS4"), msg, input=self._io.raw_input)
コード例 #7
0
ファイル: UI.py プロジェクト: tijmengit/pycopia
 def get_text(self, msg=None):
     return cliutils.get_text(self._get_prompt("PS4"),
                              msg,
                              input=self._io.raw_input)
コード例 #8
0
ファイル: core.py プロジェクト: animeshinvinci/pycopia
 def get_text(self, msg=None):
     if self.INTERACTIVE:
         return cliutils.get_text("> ", msg)
     else:
         raise TestIncompleteError, "user input in non-interactive test."
コード例 #9
0
ファイル: core.py プロジェクト: animeshinvinci/pycopia
 def get_text(self, msg=None):
     if self.INTERACTIVE:
         return cliutils.get_text("> ", msg)
     else:
         raise TestIncompleteError, "user input in non-interactive test."