def insert_new_characters(self):
        self.total_count = 0
        self.inserted_count = 0

        for character_id in self._get_not_existed_ids():
            self.total_count += 1
            try:
                # 逐一根據其 ID 開啟新增視窗
                character = Character.create_by_cgdt_character(self.data_owner.find_character_by_id(character_id))
                popup = CharacterWindow(self.view, character, lambda: self._insert_new_character(character))
                self.view.wait_window(popup)
            # 若資料取得發生問題,則記錄後就略過
            except StandardError as e:
                print e

        tkMessageBox.showinfo(
            "Completed", "總計 {0} 筆新資料,其中 {1} 筆新增完成".format(self.total_count, self.inserted_count), parent=self.view
        )
    def update_new_characters(self):
        self.total_count = 0
        self.updated_count = 0

        for character_name in self._get_new_character_names():
            self.total_count += 1
            try:
                # 逐一根據其 FullName 開啟更新視窗
                character = Character.create_by_cgdt_character(
                    self.data_owner.find_character_by_full_name(character_name)
                )
                popup = CharacterWindow(self.view, character, lambda: self._update_new_character_with_its_id(character))
                self.view.wait_window(popup)
            # 若資料取得發生問題,則記錄後就略過
            except StandardError as e:
                print e

        tkMessageBox.showinfo(
            "Completed", "總計 {0} 筆新資料,其中 {1} 筆更新完成".format(self.total_count, self.updated_count), parent=self.view
        )
Beispiel #3
0
    def insert_new_characters(self):
        self.total_count = 0
        self.inserted_count = 0

        for character_id in self._get_not_existed_ids():
            self.total_count += 1
            try:
                # 逐一根據其 ID 開啟新增視窗
                character = Character.create_by_cgdt_character(
                    self.data_owner.find_character_by_id(character_id))
                popup = CharacterWindow(
                    self.view, character,
                    lambda: self._insert_new_character(character))
                self.view.wait_window(popup)
            # 若資料取得發生問題,則記錄後就略過
            except StandardError as e:
                print e

        tkMessageBox.showinfo('Completed',
                              '總計 {0} 筆新資料,其中 {1} 筆新增完成'.format(
                                  self.total_count, self.inserted_count),
                              parent=self.view)
Beispiel #4
0
    def update_new_characters(self):
        self.total_count = 0
        self.updated_count = 0

        for character_name in self._get_new_character_names():
            self.total_count += 1
            try:
                # 逐一根據其 FullName 開啟更新視窗
                character = Character.create_by_cgdt_character(
                    self.data_owner.find_character_by_full_name(
                        character_name))
                popup = CharacterWindow(
                    self.view, character,
                    lambda: self._update_new_character_with_its_id(character))
                self.view.wait_window(popup)
            # 若資料取得發生問題,則記錄後就略過
            except StandardError as e:
                print e

        tkMessageBox.showinfo('Completed',
                              '總計 {0} 筆新資料,其中 {1} 筆更新完成'.format(
                                  self.total_count, self.updated_count),
                              parent=self.view)