Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101640083
infogmov
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 12, 08:42
Size
2 KB
Mime Type
text/x-python
Expires
Fri, Feb 14, 08:42 (2 d)
Engine
blob
Format
Raw Data
Handle
24206273
Attached To
rPNBODY pNbody
infogmov
View Options
#!/usr/bin/env python
import sys
import os
import string
import getopt
import math
from pNbody import Movie
####################################################################################
def version():
####################################################################################
print 'version 1.0'
sys.exit(0)
####################################################################################
def help_message():
####################################################################################
print '''Usage : infogmov -f film [options]
This function gives info on a film
Options: -h -- this help message
-f -- name of the input
--help -- this help message
--version -- displays version
'''
sys.exit(0)
####################################################################################
def check_arguments(options,xarguments):
####################################################################################
n1 = 0
n2 = 0
output = "out.mov"
input = None
info = None
for a in options[:]:
if a[0] == '-h':
help_message()
if a[0] == '--help':
help_message()
if a[0] == '--version':
version()
if a[0] == '-f':
if a[1] == '':
help_message()
else:
input = a[1]
continue
if input == None:
help_message()
return input
####################################################################################
#
# MAIN
#
####################################################################################
try:
options, xarguments = getopt.getopt(sys.argv[1:],'f:h', ['help','version'])
except getopt.error:
help_message()
sys.exit(0)
# check arguments
film = check_arguments(options,xarguments)
# check that the film exists
if (os.path.exists(film)==0):
print "Error : the file ",film," do no not exist."
sys.exit(0)
# open the file
fi = Movie.Movie(film)
fi.open()
# write info
fi.info()
Event Timeline
Log In to Comment