Example #1
0
 def __init__(self,
              host_ip="localhost",
              host_port=4400,
              key_file=".pvtkey.txt"):
     """Método construtor do cliente
     
     Inicia um socket em uma porta livre
     
     Args:
         host_ip (str): endereço de IP do servidor
         host_port (int): porta do servidor
         key_file (str): arquivo com as informações da cahve
     """
     Console.__init__(self, key_file=key_file)
     self.peer = (host_ip, host_port)
     self.usr = '******'
    def __init__(self, matcher):
        Console.__init__(self)
        self.config = self._default_config
        self.prompt = ">> "
        self.intro = "Welcome to the CBR system. Type 'help' for a list of commands."
        self.matcher = matcher
        if not self.matcher.cases:
            self.intro += "\nNOTE: Currently no cases loaded (you may want to run parser.py to generate some)!"

        self.query = Case()
        self.result = []
        if not sys.stdin.isatty():
            self.prompt = self.intro = ""
            self.interactive = False
            self.config['auto_run'] = False
        else:
            self.interactive = True
Example #3
0
    def __init__(self, matcher):
        Console.__init__(self)
        self.config = self._default_config
        self.prompt = ">> "
        self.intro = "Welcome to the CBR system. Type 'help' for a list of commands."
        self.matcher = matcher
        if not self.matcher.cases:
            self.intro += "\nNOTE: Currently no cases loaded (you may want to run parser.py to generate some)!"

        self.query = Case()
        self.result = []
        if not sys.stdin.isatty():
            self.prompt = self.intro = ""
            self.interactive = False
            self.config['auto_run'] = False
        else:
            self.interactive = True
Example #4
0
 def __init__(self):
     Console.__init__(self)
Example #5
0
 def __init__(self, *args, **kwargs):
     Console.__init__(self, *args, **kwargs)
     self.stdout = k32.GetStdHandle(STD_OUTPUT_HANDLE)