Ejemplo n.º 1
0
class DataThread(QObject):

    def __init__(self, parent=None):
        QObject.__init__(self, parent)
        self.config_parser = ConfigParser(config_dir=CONFIG_DIR)
        self.config = self.config_parser.get_config(CONFFILE_NAME_DATA)
        self._update_path()
        self.engines = self._setup_engines()
        self.thread = WindowThread()
        self.weather_data_engine = DataEngine(location_code=LOCATION_CODE)
        self.weather_data_engine.signal_set_data.connect(
        self.thread.main_window.weather_widget.forecast1.set_data)
        self.weather_data_engine.update_data()

    def _update_path(self):
        sys.path.append(self.config[ENGINES_DIR_NAME_IN_CONFIG])

    def _setup_engines(self):
        return_dict = {}
        engines = self.config[ENGINES_NAME_IN_CONFIG].keys()
        for engine in engines:
            pass