コード例 #1
0
ファイル: status.py プロジェクト: v-manip/ngeo-b
    def _status_config(self):
        status_config_path = get_status_config_path(self.config)
        if not exists(status_config_path):
            write_status_config(status_config_path)

        parser = ConfigParser()
        with open(status_config_path) as f:
            parser.readfp(f)
        return parser
コード例 #2
0
ファイル: status.py プロジェクト: baloola/ngeo-b
    def _status_config(self):
        status_config_path = get_status_config_path(self.config)
        if not exists(status_config_path):
            write_status_config(status_config_path)

        parser = ConfigParser()
        with open(status_config_path) as f:
            parser.readfp(f)
        return parser
コード例 #3
0
ファイル: status.py プロジェクト: v-manip/ngeo-b
    def _set_status(self, new_status):
        new_status = new_status.upper()
        if not new_status in self.states:
            raise ValueError("Invalid state '%s'." % new_status)

        status_config = self._status_config()

        if not status_config.has_section(STATUS_SECTION):
            status_config.add_section(STATUS_SECTION)
        status_config.set(STATUS_SECTION, "state", new_status)
        write_status_config(get_status_config_path(self.config), status_config)
コード例 #4
0
ファイル: status.py プロジェクト: baloola/ngeo-b
    def _set_status(self, new_status):
        new_status = new_status.upper()
        if not new_status in self.states:
            raise ValueError("Invalid state '%s'." % new_status)

        status_config = self._status_config()

        if not status_config.has_section(STATUS_SECTION):
            status_config.add_section(STATUS_SECTION)
        status_config.set(STATUS_SECTION, "state", new_status)
        write_status_config(get_status_config_path(self.config), status_config)