Example #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)
Example #2
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)
Example #3
0
 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
Example #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
Example #5
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).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
Example #6
0
 def get_text(self, msg=None):
     return cliutils.get_text(self._get_prompt("PS4"), msg, input=self._io.raw_input)
Example #7
0
 def get_text(self, msg=None):
     return cliutils.get_text(self._get_prompt("PS4"),
                              msg,
                              input=self._io.raw_input)
Example #8
0
 def get_text(self, msg=None):
     if self.INTERACTIVE:
         return cliutils.get_text("> ", msg)
     else:
         raise TestIncompleteError, "user input in non-interactive test."
Example #9
0
 def get_text(self, msg=None):
     if self.INTERACTIVE:
         return cliutils.get_text("> ", msg)
     else:
         raise TestIncompleteError, "user input in non-interactive test."