<# # This builds the side tree. linklist=() depthlist=() vallist=() current=() import gael page_list = [page for page in sidebar(indextree, div='', undiv='', cmp=gael.cmp_pages) if ( page['target'][-10:]=='index.html' and not page['target'][-14:]=='restindex.html') ] # Select only the nodes of the tree, and not the sub-sections. #page_list = filter(lambda x: ( x['target'][-10:]=='index.html' and not # x['target'][-14:]=='restindex.html') , page_list) #print page_list #page_list.sort(cmp=gael.cmp_pages) depthlist = map(gael.page_depth, page_list) mindepth=min(depthlist) for i, page in enumerate(page_list): link =page['target'] depth=depthlist[i]-mindepth val=page['crumb'] if (page['title'] or link=='index.html') and not depth==0: print ' <# import os import os.path fullpath=os.path.dirname(os.getcwd()+"/"+pagepath) targetpath=os.path.dirname(Processor.target+"/"+pagepath) if os.path.isdir(fullpath+"/sidebar"): gael.scandir(fullpath,targetpath,"sidebar") #>
<# if node_title == "": print title else: print node_title #>
Blog | <# print_crumbs(breadcrumbs,item = '%s') #>
<# fullpath=os.getcwd()+"/"+pagepath[:-5]+".txt" targetpath=Processor.target+"/"+pagepath[:-5]+".txt" targetdir=os.path.dirname(targetpath) if not os.path.exists(targetdir): os.makedirs(targetdir) from shutil import copyfile copyfile(fullpath,targetpath) print('') pdf_file = os.path.splitext(targetpath)[0]+'.pdf' pdf_target_file = os.path.splitext(targetpath)[0] + '.pdf' if ( not os.path.exists(pdf_target_file) or gael.cmptimestamps(pdf_file, pdf_target_file)): old_dir = os.getcwd() try: gael.rest2pdf(fullpath, pdf_target_file ) except Exception, ex: print >>sys.stderr, "Failed in compiling %s to pdf" % fullpath print >>sys.stderr, ex.__str__() # For DEBUG #print "Failed in compiling %s to pdf" % fullpath #print ex.__str__() # For DEBUG os.chdir(old_dir) if ( os.path.exists(pdf_target_file) and not gael.cmptimestamps(pdf_file, pdf_target_file)): print('') #> <# # print the subsections and their description, for each subject tag pageblock = '''\

%s

%s

''' sections.sortpages(gael.cmp_pages) try: subpages = gael.ListBySubject(sections[None]) except: pass def print_subjects(*subjects): #* """ prints the pages and there description with the given subject-tag """ print "

" global subpages pages, subsections = subpages.list(*subjects) #* if subsections: for page in subsections: print pageblock % page print "

" #> <% body %> <# fullpath=os.path.dirname(os.getcwd()+"/"+pagepath) targetpath=os.path.dirname(Processor.target+"/"+pagepath) def print_sphinx(): gael._print_sphinx(fullpath, targetpath) if os.path.isdir(fullpath+"/gallery"): print '
' print '' #>
Return to Top     Page last modified <% modtime %>.     Created by Gaël Varoquaux with rest2web
Best viewed with firefox, or any browser that respects standards.