# # Copyright, August 2003, Saul Youssef # #from Selector import * from WebPage import * from StringAttr import * from Execution import * import TrustedCaches,Collections def htmlOL(title,message0,E,w): w.text('
')
w.text('-- Environment Status --') w.text(' | ')
w.text('|
'); w.cr() w.text('Top Level Packages') w.text(' | '); w.cr() w.text(''); w.cr()
if len(E)==0:
w.bullet(1,1); w.text('No packages installed.')
else:
count = 0
for e in E:
count = count + 1
e.bullet(w); e.htmlShortLine(w)
if count!=len(E): w.text(' '); w.cr() w.text(' | '); w.cr()
#-- Installation status
w.text('
'); w.cr() w.text('Installation') w.text(' | '); w.cr() # verbo.log('web','Outlook: Installation status...') w.text(''); w.cr()
if sat:
E.bullet(w)
w.text('Environment containing '+`num_packages`+' packages with a '+`num_nodes`+' node dependency tree is successfully installed.')
else:
# r = E.satisfiable()
if r.ok():
E.bullet(w)
if E. eversatGet(): w.text('Installation environment containing '+`num_packages`+' packages is no longer satisfied.')
elif E.everfailGet(): w.text('Installation attempt has failed.')
else:
w.text('Environment containing '+`num_packages`+' packages with a '+`num_nodes`+' node dependency tree is ready to install.')
else:
rl = r.nodups()
for i in range(len(rl)):
x = rl[i]
w.bulletcross(); x.htmlOut(w);
if not i==len(rl): w.text(' ') w.cr() w.bulletcross(); w.strongText('The installation will fail unless the above problems are fixed.') w.text(' | '); w.cr()
w.text('
'); w.cr() w.text('Trusted Caches') w.text(' | '); w.cr() w.text(''); w.cr()
caches = TrustedCaches.getTrustedCaches()
xcaches = []
for c in caches:
if not c.access(): xcaches.append(c)
if len(xcaches)==0:
w.bullet(1,1); w.text('All caches are accessible.')
else:
count = 0
for c in xcaches:
count = count + 1
w.bullet(0,1); c.htmlOut(w); w.text(' is inaccessible.')
if count!=len(xcaches): w.text(' '); w.cr() w.text(' | '); w.cr()
# verbo.log('web','Oulook: Updates...')
#-- Updates
w.text('
'); w.cr() w.text('Updates') w.text(' | '); w.cr() w.text(''); w.cr()
if len(Es)==0:
w.bullet(1,1); w.text('All packages are up to date.')
else:
count = 0
for e in Es:
count = count + 1
e.bullet(w); e.htmlShortLine(w)
if count!=len(Es): w.text(' '); w.cr() w.text(' | '); w.cr()
w.text('
'); w.cr() w.text('Last Command') w.text(' | '); w.cr() w.text(''); w.cr() if rr.ok(): w.bullet(1,1); w.strongText(pcl()); w.text(' ( ok )'); else: w.bulletcross(); w.strongText(pcl()) w.text(' ( '); rr.htmlOut(w,0) w.text(' )') w.text(' | '); w.cr() w.text('
'); w.text(' '); w.text(' | ')
w.text(''); w.text(' '); w.text(' | ')
w.text('
'); w.text(''); w.text(' | ')
w.text('|
')
w.text('-- Shell Operations --') w.text(' | ')
w.text('|
'); w.cr() w.text('Root Shell Commands') w.text(' | '); w.cr() w.text(''); w.cr() if len(Es)==0: w.bullet(1,1); w.text('No shell commands as root are required.') w.cr() elif len(Es)>10: sh2 = WebPage('Shell commmands as root.') Es.htmlOut(sh2) sh2.out('E/htmls/rootshellcommands.html') w.bullet(1,1); w.link('shell commands','rootshellcommands.html') else: htmlOutLoop(Es,'No shell commands as root are required.',w) w.text(' | '); w.cr() w.text('
'); w.cr() w.text('Non-Root Shell Commands') w.text(' | '); w.cr() w.text(''); w.cr() if len(Es)==0: w.bullet(1,1); w.text('No non-root shell commands are required.') w.cr() elif len(Es)>10: sh2 = WebPage('shell commands') Es.htmlOut(sh2) sh2.out('E/htmls/nonrootshellcommands.html') w.bullet(1,1); w.link('shell commands','nonrootshellcommands.html') else: htmlOutLoop(Es,'No non-root shell commands are required.',w) w.text(' | '); w.cr() w.text('
'); w.cr()