version 1.1, 2003/10/05 19:11:09
|
version 1.9, 2004/03/03 13:02:54
|
Line 75 class filesystem(Implicit, Persistent, R
|
Line 75 class filesystem(Implicit, Persistent, R
|
|
|
def getfs(self,start): |
def getfs(self,start): |
"""load filessystem""" |
"""load filessystem""" |
|
|
f = os.popen("find "+ start+" -name '*' ","r") |
f = os.popen("find "+ start+" -name '*' ","r") |
lines = f.readlines() |
lines = f.readlines() |
|
|
Line 137 class filesystem(Implicit, Persistent, R
|
Line 138 class filesystem(Implicit, Persistent, R
|
j[k]=self.node[k] |
j[k]=self.node[k] |
return j |
return j |
|
|
|
|
def archive_the_path(self,path): |
def archive_the_path(self,path): |
"""parse indexmeta and return digilib path""" |
"""parse indexmeta and return digilib path""" |
try: |
try: |
Line 176 class filesystem(Implicit, Persistent, R
|
Line 178 class filesystem(Implicit, Persistent, R
|
if self.archive_the_path(k): |
if self.archive_the_path(k): |
j[k]=self.node[k] |
j[k]=self.node[k] |
return j |
return j |
|
|
security.declarePublic('getImageDirs') |
security.declarePublic('getImageDirs') |
def getImageDirs(self,dom,path): |
def getImageDirs(self,dom,path): |
dirs=dom.getElementsByTagName("dir") |
dirs=dom.getElementsByTagName("dir") |
Line 239 class filesystem2(Implicit, Persistent,
|
Line 242 class filesystem2(Implicit, Persistent,
|
|
|
def getfs(self,start): |
def getfs(self,start): |
"""load filessystem""" |
"""load filessystem""" |
|
|
f = os.popen("find "+ start+" -name '*' ","r") |
f = os.popen("find "+ start+" -name '*' ","r") |
lines = f.readlines() |
lines = f.readlines() |
|
|
Line 373 class browse(Implicit, Persistent, RoleM
|
Line 377 class browse(Implicit, Persistent, RoleM
|
|
|
def getfs(start): |
def getfs(start): |
"""return filesystem""" |
"""return filesystem""" |
|
|
f = os.popen("find "+ start+" -name '*'","r") |
f = os.popen("find "+ start+" -name '*'","r") |
lines = f.readlines() |
lines = f.readlines() |
return lines |
return lines |
Line 527 class metacheck(Implicit, Persistent, Ro
|
Line 532 class metacheck(Implicit, Persistent, Ro
|
return [retstr,error] |
return [retstr,error] |
else: |
else: |
return ['','running'] |
return ['','running'] |
|
|
def __init__(self,path): |
def __init__(self,path): |
"""archive the documents in path""" |
"""archive the documents in path""" |
self.lines=[] |
self.lines=[] |
Line 636 def getText(nodelist):
|
Line 642 def getText(nodelist):
|
|
|
rc = "" |
rc = "" |
for node in nodelist: |
for node in nodelist: |
|
|
if node.nodeType == node.TEXT_NODE: |
if node.nodeType == node.TEXT_NODE: |
rc = rc + node.data |
rc = rc + node.data |
return rc |
return rc |
|
|
def getBib(nodelist): |
def getBib(nodelist): |
rc= "<table border='0'>" |
rc= "<table border='0'>" |
print "HI" |
|
for node in nodelist: |
for node in nodelist: |
|
|
if node.nodeType == node.ELEMENT_NODE: |
if node.nodeType == node.ELEMENT_NODE: |
Line 685 def getMetafile(path):
|
Line 692 def getMetafile(path):
|
else: |
else: |
html=html+"<h4>Info</h4>" |
html=html+"<h4>Info</h4>" |
html=html+getBib(bib.childNodes) |
html=html+getBib(bib.childNodes) |
print html |
#print html |
except: |
except: |
"""none""" |
"""none""" |
|
|
Line 734 def isdigilib2(path):
|
Line 741 def isdigilib2(path):
|
|
|
def isFullText(path,folder_name): |
def isFullText(path,folder_name): |
"""check if foldername in path is full text""" |
"""check if foldername in path is full text""" |
|
|
try: |
try: |
dom=xml.dom.minidom.parse(path+"/index.meta") |
dom=xml.dom.minidom.parse(path+"/index.meta") |
|
except: |
|
""" nothing""" |
|
return 0 |
for node in dom.getElementsByTagName("dir"): |
for node in dom.getElementsByTagName("dir"): |
|
|
if getText(node.getElementsByTagName("content-type")[0].childNodes)=="fulltext": |
try: |
|
child=getText(node.getElementsByTagName("content-type")[0].childNodes) |
|
|
|
if child =="fulltext": |
|
|
if getText(node.getElementsByTagName("name")[0].childNodes)==folder_name: |
if getText(node.getElementsByTagName("name")[0].childNodes)==folder_name: |
return 1 |
return 1 |
return 0 |
|
except: |
except: |
|
"""nothing""" |
|
#print "erro",node |
|
#print sys.exc_info() |
|
#return 0 |
|
|
return 0 |
return 0 |
|
|
|
|
|
|
def isPresentation(path,folder_name): |
def isPresentation(path,folder_name): |
"""check if foldername in path is full text""" |
"""check if foldername in path is full text""" |
try: |
try: |
Line 853 class overview(Implicit,Persistent, Role
|
Line 871 class overview(Implicit,Persistent, Role
|
if not len(str)==0: |
if not len(str)==0: |
for line in str: |
for line in str: |
retstr=retstr+line+"<br>" |
retstr=retstr+line+"<br>" |
check=re.search(r"(.*):(.*)",line) |
check=line.split(":") |
if check.group(1)=='ABORT': |
#re.search(r"(.*):(.*)",line) |
|
if check[0]=='ABORT': |
error="error" |
error="error" |
elif check.group(1)=='DONE': |
elif check[0]=='DONE': |
error="ok" |
error="ok" |
else: |
else: |
error="running" |
error="running" |
Line 931 def EditIndex(self,path):
|
Line 950 def EditIndex(self,path):
|
indexmeta="" |
indexmeta="" |
self.REQUEST.SESSION['indexmeta']=indexmeta |
self.REQUEST.SESSION['indexmeta']=indexmeta |
self.REQUEST.SESSION['path']=path |
self.REQUEST.SESSION['path']=path |
newtemplate=PageTemplateFile('/usr/local/mpiwg/Zope/Extensions/editindex').__of__(self) |
newtemplate=PageTemplateFile('Products/OSA_system/zpt/editindex').__of__(self) |
return newtemplate() |
return newtemplate() |
|
|
def EditIndex2(self): |
def EditIndex2(self): |
if not self.REQUEST.has_key('fileupload'): |
if not self.REQUEST.has_key('fileupload'): |
#newtext=urllib.unquote(self.REQUEST['indexmeta']) |
#newtext=urllib.unquote(self.REQUEST['indexmeta']) |
newtext=self.REQUEST['indexmeta'] |
newtext=self.REQUEST['indexmeta'] |
print newtext |
#print newtext |
else: |
else: |
self.file_name=self.REQUEST['fileupload'].filename |
self.file_name=self.REQUEST['fileupload'].filename |
#newtext=self.REQUEST.form['fileupload'].read() |
#newtext=self.REQUEST.form['fileupload'].read() |