Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Cittena
cittena
Commits
dbc7400a
Commit
dbc7400a
authored
Oct 07, 2018
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
itten/movie.py
View file @
dbc7400a
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment