Ejemplo n.º 1
0
 def complete_formvalue(self, text, line, begin, end):
     # formvalue <formname> <field> <value>
     cmd, args = parse.parse_command(line + '.', {}, {})
     place = len(args)
     if place == 1:
         return self.provide_formname(text)
     elif place == 2:
         formname = args[0]
         return self.provide_field(formname, text)
     return []
Ejemplo n.º 2
0
 def complete_formvalue(self, text, line, begin, end):
     # formvalue <formname> <field> <value>
     cmd, args = parse.parse_command(line + '.', {}, {})
     place = len(args)
     if place == 1:
         return self.provide_formname(text)
     elif place == 2:
         formname = args[0]
         return self.provide_field(formname, text)
     return []
Ejemplo n.º 3
0
    def default(self, line):
        "Called when unknown command is executed."

        # empty lines ==> emptyline(); here we just want to remove
        # leading whitespace.
        line = line.strip()

        # look for command
        global_dict, local_dict = namespaces.get_twill_glocals()
        cmd, args = parse.parse_command(line, global_dict, local_dict)

        # ignore comments & empty stuff
        if cmd is None:
            return

        try:
            parse.execute_command(cmd, args, global_dict, local_dict,
                                  "<shell>")
        except SystemExit:
            raise
        except Exception, e:
            logger.error('%s\n' % (str(e),))
            if self.fail_on_unknown:
                raise
Ejemplo n.º 4
0
    def default(self, line):
        "Called when unknown command is executed."

        # empty lines ==> emptyline(); here we just want to remove
        # leading whitespace.
        line = line.strip()

        # look for command
        global_dict, local_dict = namespaces.get_twill_glocals()
        cmd, args = parse.parse_command(line, global_dict, local_dict)

        # ignore comments & empty stuff
        if cmd is None:
            return

        try:
            parse.execute_command(cmd, args, global_dict, local_dict,
                                  "<shell>")
        except SystemExit:
            raise
        except Exception, e:
            print '\nERROR: %s\n' % (str(e),)
            if self.fail_on_unknown:
                raise