Commit b2f51085 authored by Niels-Oliver Walkowski's avatar Niels-Oliver Walkowski
Browse files

implement Frames.end and Frames.count_frames as properties

parent 1e6cce33
......@@ -30,8 +30,37 @@ class Frames(object):
self.frames = self.get_frame_list()
self.frm_length = self.count_total_frames()
self.start = start
self.end = self._get_end_frame(end)
self.frm_cnt = self.count_frames()
self.end = end
self.frm_cnt = 0
@property
def end(self):
return self.__end
@end.setter
def end(self, nr):
if nr == 0:
self.__end = self.frm_length
self.frm_cnt = self.count_frames
elif nr > self.frm_length:
self.__end = self.frm_length - 1
self.frm_cnt = self.count_frames
elif nr < self.start:
self.__end = self.start + 1
self.frm_cnt = self.count_frames
else:
self.__end = nr
self.frm_cnt = self.count_frames
@property
def frm_cnt(self):
return self.__frm_cnt
@frm_cnt.setter
def frm_cnt(self, nr):
count = self.count_frames()
print(count)
self.__frm_cnt = count
def get_frame_list(self):
frm_path = Path(self.folder)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment