|
|
@ -8,13 +8,13 @@ import blup.output |
|
|
|
|
|
|
|
|
|
|
|
def printUsage(errMsg=None): |
|
|
|
def printUsage(errMsg=None): |
|
|
|
if errMsg is not None: |
|
|
|
if errMsg is not None: |
|
|
|
print 'error: %s\n' % (errMsg) |
|
|
|
print('error: %s\n' % (errMsg)) |
|
|
|
print 'usage: %s [OPTIONS] FILENAME' % (sys.argv[0]) |
|
|
|
print('usage: %s [OPTIONS] FILENAME' % (sys.argv[0])) |
|
|
|
print 'supported options:' |
|
|
|
print('supported options:') |
|
|
|
print ' -o OUTPUT where to output the frames (default: shell)' |
|
|
|
print(' -o OUTPUT where to output the frames (default: shell)') |
|
|
|
print ' --output OUTPUT\n' |
|
|
|
print(' --output OUTPUT\n') |
|
|
|
print ' -h print this text' |
|
|
|
print(' -h print this text') |
|
|
|
print ' --help' |
|
|
|
print(' --help') |
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
def main(): |
|
|
|
try: |
|
|
|
try: |
|
|
@ -24,13 +24,13 @@ def main(): |
|
|
|
printUsage(e.msg) |
|
|
|
printUsage(e.msg) |
|
|
|
sys.exit(1) |
|
|
|
sys.exit(1) |
|
|
|
|
|
|
|
|
|
|
|
if opts.has_key('--help'): |
|
|
|
if '--help' in opts: |
|
|
|
printUsage() |
|
|
|
printUsage() |
|
|
|
sys.exit(0) |
|
|
|
sys.exit(0) |
|
|
|
|
|
|
|
|
|
|
|
if opts.has_key('-o'): |
|
|
|
if '-o' in opts: |
|
|
|
output = opts['-o'] |
|
|
|
output = opts['-o'] |
|
|
|
elif opts.has_key('--output'): |
|
|
|
elif '--output' in opts: |
|
|
|
output = opts['--output'] |
|
|
|
output = opts['--output'] |
|
|
|
else: |
|
|
|
else: |
|
|
|
output = 'shell' |
|
|
|
output = 'shell' |
|
|
@ -38,12 +38,12 @@ def main(): |
|
|
|
try: |
|
|
|
try: |
|
|
|
out = blup.output.getOutput(output) |
|
|
|
out = blup.output.getOutput(output) |
|
|
|
except blup.output.IllegalOutputSpecificationError: |
|
|
|
except blup.output.IllegalOutputSpecificationError: |
|
|
|
print 'illegal output specification' |
|
|
|
print('illegal output specification') |
|
|
|
print 'available outputs:' |
|
|
|
print('available outputs:') |
|
|
|
print blup.output.getOutputDescriptions() |
|
|
|
print(blup.output.getOutputDescriptions()) |
|
|
|
sys.exit(1) |
|
|
|
sys.exit(1) |
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
print 'could not initialize output: %s' % (str(e)) |
|
|
|
print('could not initialize output: %s' % (str(e))) |
|
|
|
sys.exit(1) |
|
|
|
sys.exit(1) |
|
|
|
|
|
|
|
|
|
|
|
if len(args) != 2: |
|
|
|
if len(args) != 2: |
|
|
@ -53,7 +53,7 @@ def main(): |
|
|
|
try: |
|
|
|
try: |
|
|
|
anim = blup.animation.load(args[1]) |
|
|
|
anim = blup.animation.load(args[1]) |
|
|
|
except blup.animation.AnimationFileError: |
|
|
|
except blup.animation.AnimationFileError: |
|
|
|
print 'could not load animation' |
|
|
|
print('could not load animation') |
|
|
|
sys.exit(1) |
|
|
|
sys.exit(1) |
|
|
|
|
|
|
|
|
|
|
|
player = blup.animation.AnimationPlayer() |
|
|
|
player = blup.animation.AnimationPlayer() |
|
|
|