[Zope] Creating files on server

ghaley@mail.venaca.com ghaley@mail.venaca.com
Tue, 24 Apr 2001 09:54:24 -0400 (EDT)


> 
> Sorry ... this didn't tell me anything new :-)
> I'll try post the script again, it looks like this:
> 
> ****************** writesmil.py *********************
> 
> from sys import argv
> 
> if len(argv)-1 != 6:
>   print str(len(argv)-1) + " args resived. Need 6!"
> else:
>   server, mediafile, tcin, tcout, id, clipname = argv[1], argv[2],
> argv[3], argv[4], argv[5], argv[6]
>   fil = open("/root/Real/Content/" + id + clipname + ".smil", 'w')
> #Open file
>   text = "<smil>\n\t<body>\n\t\t<audio src=\"rtsp:" + server + "/" +
> mediafile + ".rm\" clip-begin=\"" + tcin + "\" clip-end=\"" + tcout +
> "\">\n\t</body>\n</smil>\n"
>   fil.write(text)
>   fil.close()
> 
> ***************** /writesmil.py **********************

Your dtml will be sending the argv values, so your def will look something
like:

def smil(self, server, mediafile, tcin, tcout, id, clipname):
	
then you can probably omit the if loop, since your method will be sending
the data, and you won't need to test for completeness of the input data.

when you set up your external method, you will create a method name (it
can be the same as the function you are calling) tell it what function you
are calling (smil), and the name of the python script containing it
(writesmil) -- you do not need to include the .py in this part.  so, your
field might look like:

hth.

ciao!
greg.

Gregory Haley
DBA/Web Programmer
Venaca, LLC.