Browse Source

added --no-loop option

feature/balanceutils
Fr3deric 7 years ago
parent
commit
062c2efdb9
  1. 7
      utils/blmplay.py

7
utils/blmplay.py

@ -12,13 +12,14 @@ def printUsage(errMsg=None): @@ -12,13 +12,14 @@ def printUsage(errMsg=None):
print('usage: %s [OPTIONS] FILENAME' % (sys.argv[0]))
print('supported options:')
print(' -o OUTPUT where to output the frames (default: shell)')
print(' --no-loop play animation only once')
print(' --output OUTPUT\n')
print(' -h print this text')
print(' --help')
def main():
try:
(opts, args) = getopt.gnu_getopt(sys.argv, 'ho:', ['help', 'output='])
(opts, args) = getopt.gnu_getopt(sys.argv, 'ho:', ['help', 'output=', 'no-loop'])
opts = dict(opts)
except getopt.GetoptError as e:
printUsage(e.msg)
@ -35,6 +36,8 @@ def main(): @@ -35,6 +36,8 @@ def main():
else:
output = 'shell'
loop = '--no-loop' not in opts
try:
out = blup.output.getOutput(output)
except blup.output.IllegalOutputSpecificationError:
@ -60,6 +63,8 @@ def main(): @@ -60,6 +63,8 @@ def main():
try:
while True:
player.play(anim, out)
if not loop:
break
except KeyboardInterrupt:
sys.exit(0)

Loading…
Cancel
Save