Exemple #1
0
    def __init__(self):
        super(MainWindow, self).__init__()

        self.configure()

        dao = Dao()
        where_dict = {"codigo": 1234, "nome": 'rui'}
        dao.select(where_dict=where_dict)
Exemple #2
0
    :return: nil
    """
    loop = asyncio.get_event_loop()
    loop.create_task(background_tasks(taxii_local=taxii_local, build=build, json_file=json_file))
    loop.create_task(ml_svc.check_nltk_packs())
    loop.run_until_complete(init(host, port))
    try:
        loop.run_forever()
    except KeyboardInterrupt:
        pass


if __name__ == '__main__':
    logging.getLogger().setLevel('DEBUG')
    logging.info('Welcome to TRAM')
    dao = Dao(os.path.join('database', 'tram.db'))

    with open('conf/config.yml') as c:
        config = yaml.safe_load(c)
        conf_build = config['build']
        host = config['host']
        port = config['port']
        taxii_local = config['taxii-local']
        json_file = os.path.join('models', config['json_file'])
        attack_dict = None
        if conf_build:
            build = True
            if taxii_local == 'local-json' and bool(os.path.isfile(json_file)):
                logging.debug("Will build model from static file")
                attack_dict = os.path.abspath(json_file)
Exemple #3
0
 def get_dao(self) -> Dao:
     """DAO singleton"""
     if not self.__dao:
         self.__dao = Dao()
     return self.__dao