beautypg.com

Ncast telepresenter reference manual – NCast Telepresenter M4 User Manual

Page 94

background image

NCast Telepresenter Reference Manual

filein.close()
fileout.close()

# Remove file if requested

if remove:

url = "http://" + host + "/backup/remove.cgi?file=" + mp4

if debug:

print "ncfiles: Removing", url

try:

filerm = urllib2.urlopen(url)

except urllib2.URLError, msg:

print "ncfiles: Urllib2 error (%s):" % msg
return False

except socket.error, (errno, strerror):

print "ncfiles: Socket error (%s) for host %s (%s)" % (errno, host, strer-

ror)

return False

filerm.close()

return True

# Main Program -------------------------------------------------------

hostlist = []
debug = False
inputfile = None
user = "backup"
pswd = "ncast"
realm = "NCast M3"
remove = False

def Usage():
print "Usage: ncfiles.py -d -f hostfile -h -p password -r -v --debug
--file=hostfile --help --pswd=password --remove --version host host1 host2 ..."

try:
options, args = getopt.getopt(sys.argv[1:], 'df:hp:rv:', ['debug', 'file=', 'help',
'pswd=', 'remove', 'version'])
except getopt.GetoptError:
Usage()
sys.exit(2)

for o, a in options:
if o in ("-d", "--debug"):
debug = True
if o in ("-h", "--help"):
Usage()
sys.exit()
if o in ("-p", "--pswd"):
pswd = a
if o in ("-r", "--remove"):
remove = True
if o in ("-v", "--version"):
print "ncfiles.py Version 1.0"
sys.exit()
if o in ("-f", "--file"):
inputfile = a

NCast Corporation

Revision 2.2

Page 94

This manual is related to the following products: