Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F123925373
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, Jul 30, 09:58
Size
2 KB
Mime Type
text/x-python
Expires
Fri, Aug 1, 09:58 (2 d)
Engine
blob
Format
Raw Data
Handle
27778641
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