(self,
instance = None,
update_existing_only = False)
| 2012 | instance_list = self.instance_list_new) |
| 2013 | |
| 2014 | def sequence_update(self, |
| 2015 | instance = None, |
| 2016 | update_existing_only = False): |
| 2017 | logger.debug('Checking update sequence: video_mode:{} interpolated:{} machine_made:{}'.format(self.video_mode, |
| 2018 | self.instance.interpolated if self.instance else None, |
| 2019 | self.instance.machine_made if self.instance else None)) |
| 2020 | if self.video_mode is False: |
| 2021 | return |
| 2022 | |
| 2023 | if self.instance.interpolated is True: |
| 2024 | return |
| 2025 | |
| 2026 | if self.instance.machine_made is True: |
| 2027 | return |
| 2028 | |
| 2029 | if self.do_update_sequences is False: |
| 2030 | return |
| 2031 | |
| 2032 | logger.debug('Updating sequence Mode:{} Instance:{} VideoParent:{}'.format(self.video_mode, |
| 2033 | self.instance.id, |
| 2034 | self.video_parent_file)) |
| 2035 | # For "Human" updates only |
| 2036 | if update_existing_only is False: |
| 2037 | |
| 2038 | updated_sequence, is_new_sequence = Sequence.update( |
| 2039 | session = self.session, |
| 2040 | project = self.project, |
| 2041 | video_mode = self.video_mode, |
| 2042 | instance = instance, |
| 2043 | video_file = self.video_parent_file |
| 2044 | ) |
| 2045 | if updated_sequence is not None and not updated_sequence.archived: |
| 2046 | self.sequence = updated_sequence |
| 2047 | if is_new_sequence: |
| 2048 | self.new_created_sequence_list.append(self.sequence) |
| 2049 | self.update_sequence_id_in_cache_list(instance = instance) |
| 2050 | return updated_sequence |
| 2051 | else: |
| 2052 | # Eg for deleting when sequence is changed on existing instance |
| 2053 | sequence = Sequence.update_single_existing_sequence( |
| 2054 | session = self.session, |
| 2055 | instance = instance, |
| 2056 | video_file = self.video_parent_file |
| 2057 | ) |
| 2058 | self.update_sequence_id_in_cache_list(instance = instance) |
| 2059 | |
| 2060 | return sequence |
| 2061 | |
| 2062 | # Tested |
| 2063 | def check_polygon_points_and_build_bounds(self): |
no test coverage detected