version 1.36, 2004/10/04 12:57:03
|
version 1.39, 2004/11/24 17:22:47
|
Line 52 def getISO():
|
Line 52 def getISO():
|
|
|
ret={} |
ret={} |
for lineraw in f: |
for lineraw in f: |
line=lineraw.encode('ascii','replace') |
line=lineraw.encode('ascii','replace').strip() |
value=string.split(line,'\t')[0].encode('ascii','replace') |
value=string.split(line,'\t')[0].encode('ascii','replace') |
key=string.split(line,'\t')[1].encode('ascii','replace') |
key=string.split(line,'\t')[1].encode('ascii','replace') |
ret[key]=value |
ret[key]=value |
Line 147 def add4(self):
|
Line 147 def add4(self):
|
|
|
try: |
try: |
#os.popen('mkdir '+self.REQUEST.SESSION['path']) |
#os.popen('mkdir '+self.REQUEST.SESSION['path']) |
os.mkdir(self.REQUEST.SESSION['path']) |
os.mkdir(os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name'])) |
os.chmod(self.REQUEST.SESSION['path'],0775) |
os.chmod(os.path.join(self.REQUEST.SESSION['path'],self.REQUEST['folder_name']),0775) |
|
|
except: |
except: |
|
|
"""nothing""" |
"""nothing""" |
|
|
if self.REQUEST['submit']=="upload images": |
if self.REQUEST['submit']=="upload images": |
Line 172 def add4(self):
|
Line 173 def add4(self):
|
|
|
def add5(self): |
def add5(self): |
"""ADD INDEX.META""" |
"""ADD INDEX.META""" |
|
try: |
os.chmod(self.REQUEST.SESSION['path'],0775) |
os.chmod(self.REQUEST.SESSION['path'],0775) |
|
except: |
|
pass |
|
|
newtemplate=PageTemplateFile('Products/OSA_system/zpt/OSAS_add_metadata').__of__(self) |
newtemplate=PageTemplateFile('Products/OSA_system/zpt/OSAS_add_metadata').__of__(self) |
return newtemplate() |
return newtemplate() |
|
|
Line 200 def add6(self):
|
Line 205 def add6(self):
|
metapath=self.add_metadata['archive-path']+"/"+self.add_metadata['folder_name']+"/index.meta" |
metapath=self.add_metadata['archive-path']+"/"+self.add_metadata['folder_name']+"/index.meta" |
|
|
f=open(metapath,'w') |
f=open(metapath,'w') |
f.write(renderxml) |
f.write(renderxml.encode('utf-8')) |
f.close() |
f.close() |
os.chmod(metapath,0664) |
os.chmod(metapath,0664) |
os.popen('chmod -R 0775 %s'%self.add_metadata['archive-path']+"/"+self.add_metadata['folder_name']) |
os.popen('chmod -R 0775 %s'%self.add_metadata['archive-path']+"/"+self.add_metadata['folder_name']) |
Line 259 def addPresentation(self,path):
|
Line 264 def addPresentation(self,path):
|
except: |
except: |
date="" |
date="" |
i=1 |
i=1 |
while os.path.exists("%02d-presentation"%i): |
while os.path.exists(path+"/%02d-presentation"%i): |
i+=1 |
i+=1 |
self.REQUEST.SESSION['presentationname']="%02d-presentation"%i |
self.REQUEST.SESSION['presentationname']="%02d-presentation"%i |
self.REQUEST.SESSION['path']=path |
self.REQUEST.SESSION['path']=path |
Line 304 def addPresentation2(self):
|
Line 309 def addPresentation2(self):
|
f.write(xmlinfo) |
f.write(xmlinfo) |
f.close() |
f.close() |
try: |
try: |
os.chmod(path+"/"+folder_name,0755) |
os.chmod(path+"/"+folder_name,0775) |
except: |
except: |
"""NO""" |
"""NO""" |
|
|
os.chmod(path+"/"+folder_name+"/"+file_name,0644) |
os.chmod(path+"/"+folder_name+"/"+file_name,0664) |
addDirsToIndexMeta(path,folder_name,content_description,'presentation') |
addDirsToIndexMeta(path,folder_name,content_description,'presentation') |
|
|
return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL2']+'?path='+path) |
return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL2']+'?path='+path) |