wrong indentation

This commit is contained in:
jb-alvarado 2019-03-09 20:12:20 +01:00
parent 6dc6e3c40b
commit bdb7c082e5

View File

@ -617,12 +617,12 @@ class GetSourceIter:
# check last modification from playlist # check last modification from playlist
mod_time = os.path.getmtime(self.json_file) mod_time = os.path.getmtime(self.json_file)
if mod_time > self.last_mod_time: if mod_time > self.last_mod_time:
with open(self.json_file) as f: with open(self.json_file, 'r') as f:
self.clip_nodes = json.load(f) self.clip_nodes = json.load(f)
self.last_mod_time = mod_time self.last_mod_time = mod_time
logger.info('open: ' + self.json_file) logger.info('open: ' + self.json_file)
validate_thread(self.clip_nodes) validate_thread(self.clip_nodes)
else: else:
# when we have no playlist for the current day, # when we have no playlist for the current day,
# then we generate a black clip # then we generate a black clip
@ -666,6 +666,7 @@ class GetSourceIter:
self.first, self.last_time = check_last_item( self.first, self.last_time = check_last_item(
self.src_cmd, self.last_time, self.last) self.src_cmd, self.last_time, self.last)
# get start time from playlist
if "begin" in self.clip_nodes: if "begin" in self.clip_nodes:
h, m, s = self.clip_nodes["begin"].split(':') h, m, s = self.clip_nodes["begin"].split(':')
if is_float(h) and is_float(m) and is_float(s): if is_float(h) and is_float(m) and is_float(s):
@ -705,14 +706,14 @@ class GetSourceIter:
break break
elif self.last_time and self.last_time < self.begin: elif self.last_time and self.last_time < self.begin:
if node == self.clip_nodes["program"][-1]: if node == self.clip_nodes["program"][-1]:
last = True self.last = True
else: else:
last = False self.last = False
check_sync(self.begin) check_sync(self.begin)
self.src_cmd, self.time_left = gen_input( self.src_cmd, self.time_left = gen_input(
src, self.begin, duration, seek, out, last src, self.begin, duration, seek, out, self.last
) )
if self.time_left is None: if self.time_left is None:
@ -753,7 +754,7 @@ class GetSourceIter:
# independent thread for clip preparation # independent thread for clip preparation
def play_clips(out_file, GetSourceIter): def play_clips(out_file, GetSourceIter):
# send current file to buffer stdin # send current file to buffer stdin
iter = GetSourceIter iter = GetSourceIter()
for src_cmd in iter.next(): for src_cmd in iter.next():
if _pre_comp.copy: if _pre_comp.copy:
@ -844,7 +845,7 @@ def main():
play_thread = Thread( play_thread = Thread(
name='play_clips', target=play_clips, args=( name='play_clips', target=play_clips, args=(
mbuffer.stdin, mbuffer.stdin,
GetSourceIter(), GetSourceIter,
) )
) )
play_thread.daemon = True play_thread.daemon = True