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

make showf method work outside of zsh

the {n…n} glob pattern does not work outside of zsh
parent e71ad8f9
......@@ -32,7 +32,7 @@ class Movie(object):
self.fps = fps
self.fsize = self._frames.frm_cnt
def showf(self, start, end=0, type='time', mltp=1, viewer='sxiv -t'):
def showf(self, start, end=0, type='time', mltp=1, viewer='eog'):
"""Opens frames within the given timespan in an image viewer
start : timestamp of the start position [hh:]mm:ss or
......@@ -54,14 +54,13 @@ class Movie(object):
start = int(start) * mltp
end = int(end) * mltp
# Popen sxiv with Path and image count
if '_0' in str(self._frames.frames[0]):
glob = self._frames.folder + self._frames.prefix + '{' + '{0:04d}'.format(start) + '..'\
+ '{0:04d}'.format(end) + '}' + '.png'
else:
glob = self._frames.folder + self._frames.prefix + '{' + str(start) + '..'\
+ str(end) + '}' + '.png'
cmd = viewer + ' ' + glob
# funktioniert nur in zsh
# glob = self._frames.folder + self._frames.prefix + '{' + '{0:05d}'.format(start) + '..' + '{0:05d}'.format(end) + '}' + '.png'
glob_lst = []
for frm in range(start, end+1):
glob_lst.append(self._frames.folder + self._frames.prefix + '{0:05d}'.format(frm) + '.png')
cmd = viewer + ' ' + ' '.join(glob_lst)
Popen(cmd, stdout=PIPE, stderr=STDOUT, shell=True)
return True
......
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