[Zope] manage_addDocument

Lukas Pitschl l.pitschl@peer.biz
Mon, 09 Dec 2002 17:27:34 +0100


---------------------------
def addDocsToFolder
---------------------------

def addDocsToFolder( theFolder, theDocs):
    """

    add the given docs to the given folder

    """
    errs = StringIO.StringIO()
    for key in theDocs.keys():
        id=key
        dtml,title=theDocs[key]
        try:
        	thedtml=open(dtml.raw).read()
        except:
        	raise RuntimeError, "Can't find " + dtml.raw

        try:
            theFolder.manage_addDocument(id, title=title, file=thedtml)
        except:
            traceback.print_exc(file = errs)
        errs.seek(0)
        return errs.read()

--------------------------
admin_dtml
--------------------------

I just wanted to know if someone knows why the code of addDocsToFolder
doesn't work, if admin_dtml looks like this
admin_dtml = {
	'header'             : (getHTML('dtml/header'), "Standard Header"),
	'footer'             : (getHTML('dtml/footer'), "Standard Footer"),
	'index_html'         : (getHTML('dtml/updateArchiveForm'), "Shows form
to update the image db"),
}

thanks in advance
lukas

-- 



          ==============================
          > lukas pitschl
          > web development
          >
          > peer internet solutions
          > http://www.peer.biz
          > pillhof 25 - 39010 frangart
          > tel. +39/0471 63 10 80
          > fax +39/0471 63 17 24