当前位置: 首页>>代码示例>>Python>>正文


Python markup.page函数代码示例

本文整理汇总了Python中markup.page函数的典型用法代码示例。如果您正苦于以下问题:Python page函数的具体用法?Python page怎么用?Python page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: GenPageHTML

def GenPageHTML(head={}, topbar="", content={}):

    # Sanitize inputs
    if not ("title" in head):
        head["title"] = "Class2Go"

    if not ("scripts" in head):
        head["scripts"] = []

    if not ("css" in head):
        head["css"] = []

    if not ("meta" in head):
        head["meta"] = {}

    # CSS and JS paths to URLs
    for i, path in enumerate(head["css"]):
        head["css"][i] = STATIC_URL + "css/" + path

    temp_dict = {}
    for src, type in head["scripts"].iteritems():
        temp_dict[STATIC_URL + "js/" + src] = type
    head["scripts"] = temp_dict

    # Start of page generation
    page = markup.page()

    ## Head
    page.init(title=head["title"], css=head["css"], script=head["scripts"], metainfo=head["meta"])

    ## Body (composed inside-out)

    # Topbar
    layout_div = markup.page()
    layout_div.add(topbar)
    content_div = markup.page()

    # Left column
    if "l" in content["layout"]:
        content_div.div(
            content["l"]["content"], class_="layout_left_column", style="width:%s;" % (content["l"]["width"])
        )

        # Main column
        content_div.div(
            content["l"]["content"], class_="layout_main_column", style="width:%s;" % (content["l"]["width"])
        )

    # Right column
    if "r" in content["layout"]:
        content_div.div(
            content["r"]["content"], class_="layout_right_column", style="width:%s;" % (content["r"]["width"])
        )

    layout_div.add(content_div.__str__())
    page.add(layout_div.__str__())

    return page.__str__()
开发者ID:nyn531,项目名称:class2go,代码行数:58,代码来源:page_shell.py

示例2: GenPageHTML

def GenPageHTML(head = {}, topbar = '', content = {}):
	
	# Sanitize inputs
	if not('title' in head):
		head['title'] = 'Class2Go'
	
	if not('scripts' in head):
		head['scripts'] = []
		
	if not('css' in head):
		head['css'] = []
		
	if not('meta' in head):
		head['meta'] = {}
	
	# CSS and JS paths to URLs
	for i, path in enumerate(head['css']):
		head['css'][i] = STATIC_URL + 'css/' + path
	
	temp_dict = {}
	for src,type in head['scripts'].iteritems():
		temp_dict[STATIC_URL + 'js/' + src] = type
	head['scripts'] = temp_dict
	
	# Start of page generation
	page = markup.page()

	## Head
	page.init(title = head['title'], css = head['css'], script = head['scripts'], metainfo = head['meta'])
	
	## Body (composed inside-out)
	
	
	# Topbar
	layout_div = markup.page()
	layout_div.add(topbar)
	content_div = markup.page()
	
	
	# Left column
	if ('l' in content['layout']):
		content_div.div(content['l']['content'], class_='layout_left_column', style='width:%s;'%(content['l']['width']))
		
	# Main column
		content_div.div(content['l']['content'], class_='layout_main_column', style='width:%s;'%(content['l']['width']))
	
	# Right column
	if ('r' in content['layout']):
		content_div.div(content['r']['content'], class_='layout_right_column', style='width:%s;'%(content['r']['width']))
		
	layout_div.add(content_div.__str__())
	page.add(layout_div.__str__())
	
	return page.__str__()
开发者ID:kluo,项目名称:class2go,代码行数:54,代码来源:page_shell.py

示例3: make_html

def make_html(component_dict, sorted_names=None, title='Simulation'):
    '''Returns a markup.page instance suitable for writing to an html file.
    '''
    import markup
    if sorted_names == None:
        sorted_names = sorted(component_dict.keys())
    page = markup.page()
    page.h1('The components of {0}'.format(title))
    page.ul()
    for name in sorted_names:
        page.li(component_dict[name].html(name))
    page.ul.close()
    page.br( )
    
    page.h1('Provenance of components')
    page.dl()
    for name in sorted_names:
        c = component_dict[name]
        page.add(c.provenance.html(name))
    page.dl.close()
    page.br( )
    
    page.h1('Extended displays of component values')
    page.dl()
    for name in sorted_names:
        c = component_dict[name]
        if c.display == False:
            continue
        key = 'value of {0}'.format(name)
        page.add(markup.oneliner.dt(key,id=key)+'\n'+
                 markup.oneliner.dd(c.display())
                 )
    page.dl.close()
    return page
开发者ID:steve855,项目名称:metfie,代码行数:34,代码来源:cmf_models.py

示例4: loadIndex

def loadIndex():
		page = markup.page( )
		page.init( css="( 'layout.css', 'alt.css', 'images.css' )" )
		page.div( class_='header' )
		page.h1("Soap Explorer")
		page.div.close( )
		page.div( class_='content' )
		page.h2("Service parameters")
		page.form(name_="input",method_="post",action_="servicelist")
		page.add("server:")
		page.input(id="server",type="text",name="server")
		page.br()
		page.add("poolalias:")
		page.input(id="poolalias",type="text",name="poolalias")
		page.br()	
		page.add("user:")
		page.input(id="user",type="text",name="user")
		page.br()	
		page.add("pass:")
		page.input(id="pass",type="text",name="pass")
		page.br()
		page.input(type_="submit",value_="load",class_="load")
		page.form.close()
		page.div.close( )
		page.div( class_='footer' )
		page.p("footer")
		page.div.close( )
		return page
开发者ID:screwt,项目名称:PySOAPExplorer,代码行数:28,代码来源:PXSPage.py

示例5: __str__

    def __str__(self):
        page = markup.page( )
        page.init(
            title=self.title, 
            css=self.css, 
            header=self.header, 
            footer=self.footer
            )
        
        page.h1(self.title)
        
        if len(self.subdirs):
            links = []
            for s in sorted(self.subdirs, key=operator.attrgetter('path')):
                print s.path
                base = os.path.basename(s.path)
                link = e.a(base,
                           href='/'.join([base, 'index.html']))
                links.append(link)
            page.h2('Subdirectories:')
            page.ul( class_='mylist' )
            page.li( links, class_='myitem' )
            page.ul.close()

        size = 100/self.nimagesperrow - 1
        if len(self.images):
            for rimgs in split(sorted(self.images), self.nimagesperrow):
                page.img( src=rimgs, width='{size}%'.format(size=size),
                          alt=rimgs)
                page.br()
        return str(page)
开发者ID:mariadalfonso,项目名称:cmg-wmass-44X,代码行数:31,代码来源:DirectoryTree.py

示例6: create_html

def create_html(directory,files):

    items = tuple(files)
    paras = ( "Quick and dirty output from oban program" )
    images = tuple(files)
    
    page = markup.page( )
    page.init( title="My title", 
    css=( 'one.css', 'two.css' ), 
    header="Objective Analysis of dBZ and Vr from each sweep file") 

# hack in an embedded tag for images - markup.py probably has a way to do this better...

    img_src = []
    for item in files:
        img_src.append("<img src='%s',  width='%s', height='%s'>" % (item,"300","600"))
    
    page.p( paras )
    page.a( tuple(img_src), href=images, title=images)
    
    html_file = open(str(directory)+".html", "w")
    html_file.write(page())
    html_file.close()
    html_file = open(str(directory)+"/"+str(directory)+".html", "w")
    html_file.write(page())
    html_file.close()
    return
开发者ID:hhuangmeso,项目名称:opaws,代码行数:27,代码来源:PlotOban.py

示例7: create_html_diff

def create_html_diff(files):
	"""
	"""
	p = markup.page()
	p.html.open()
	p.script(src='https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js')
	p.script.close()
	p.style(inline_css)
	p.body.open()
	p.h1("Diff Viewer")
	p.div.open(class_='outer center')
	for file_changes in files:
		p.h3(file_changes[0])
		p.table.open(class_="center")
		p.tr.open()
		p.th(("Current", "Old"), class_="test")
		p.tr.close()
		for change in file_changes:
			if type(change) == dict:
				p.tr.open()
				p.td((change['left'], change['right']))
				p.tr.close()
		p.table.close()
	p.div.close()
	p.body.close()
	fl = open(os.getcwd()+"\\diffs.html", "w+")
	fl.write(str(p))
	print "Generated diffs.html in the current folder."
	fl.close()
开发者ID:deyboy90,项目名称:diff_analyzer,代码行数:29,代码来源:diff_analyzer.py

示例8: generateHTMLTable

 def generateHTMLTable(columnNames,table_type,countTD=1):
     snippet = markup.page()
     titles = columnNames['labels']
     inputids = columnNames['columns']
     snippet.table(width="100%")
     if countTD == 1:
         for i in range(len(titles)):
             snippet.tr()
             snippet.td(oneliner.p(titles[i]),align='center')
             snippet.td(oneliner.input(id=(inputids[i]+table_type)),align='center')
             snippet.tr.close()
         snippet.tr()
         snippet.td(style='padding-top: 10px;',align="center")
         snippet.td(oneliner.input(id="Cancel"+table_type,type="button",value="取消"),align='center')
         snippet.td(oneliner.input(id="Save"+table_type,type="button",value="保存"),align='center')
         snippet.tr.close()
     elif countTD == 3:
         i=0
         while (i < len(titles)):
             snippet.tr()
             snippet.td(oneliner.p(titles[i]),align='left')
             snippet.td(oneliner.input(id=(inputids[i]+table_type)),align='left')
             i=i+1
             if i < len(titles):
                 snippet.td(oneliner.p(titles[i]),align='left')
                 snippet.td(oneliner.input(id=(inputids[i]+table_type)),align='left')
             i=i+1
             if i < len(titles):
                 snippet.td(oneliner.p(titles[i]),align='left')
                 snippet.td(oneliner.input(id=(inputids[i]+table_type)),align='left')
             snippet.tr.close()
             i=i+1
     snippet.table.close()
     return str(snippet)
开发者ID:thinkvisionjin,项目名称:bidding,代码行数:34,代码来源:uigenerator.py

示例9: drawMatrix

def drawMatrix(data):
    panel = markup.page()
    helper.link_css_and_js(panel)
    full_names = {'dom': 'Domesticus', 'mus': 'Musculus', 'cas': 'Castaneus', 'unk': 'Unknown'}
    panel.table()
    panel.tr()
    panel.td('')
    panel.td("Distal interval: Chromosome {}: {:,} - {:,}".format(*tuple(data['Intervals'][1])))
    panel.tr.close()
    panel.tr()
    panel.td("Proximal interval: Chromosome {}: {:,} - {:,}".format(*tuple(data['Intervals'][0])))
    panel.td()
    panel.table(_class="table table-striped")
    panel.tr()
    panel.th('')
    for subspecies in data['Key']:
        panel.th(full_names[subspecies])
    panel.tr.close()
    for subspecies, samples in zip(data['Key'], data['Samples']):
        panel.tr()
        panel.th(full_names[subspecies])
        for sample_set in samples:
            panel.td(', '.join(sample_set) or '-')
        panel.tr.close()
    panel.table.close()
    panel.td.close()
    panel.tr.close()
    panel.table.close()
    return panel
开发者ID:sgreenstein,项目名称:pairwise-subspecific-origins,代码行数:29,代码来源:OriginsAtPointPairApp.py

示例10: indexPage

def indexPage(form):
    tl = twolocus.TwoLocus('/csbiodata/public/www.csbio.unc.edu/htdocs/sgreens/pairwise_origins/')
    panel = markup.page()
    helper.link_css_and_js(panel)
    panel.div(style="padding:20px 20px;")
    user, permissionLevel, date, time, elapsed = cgAdmin.getCompgenCookie(form)
    editFlag = (form.getvalue("edit") == "True")
    if permissionLevel >= 80:
        panel.add(WikiApp.editTag("%s" % this_file, not editFlag))
    panel.add(WikiApp.getWikiContent("%s" % this_file, editInPlace=(permissionLevel >= 80) and editFlag,
                                     returnPage="./?run=%s" % this_file))
    panel.br()
    panel.form(_class="form-horizontal", action="", method="POST", enctype="multipart/form-data")
    panel.div(_class="control-group")
    panel.h3('Background Samples')
    has_bg_strains = helper.strain_set_selector(panel, tl, 'background')
    panel.h3('Foreground Samples')
    has_fg_strains = helper.strain_set_selector(panel, tl, 'foreground')
    panel.script("""$(".chosen").chosen()""", type="text/javascript")
    panel.script('''$("form").submit(function () {return %s() && %s();});''' % (has_bg_strains, has_fg_strains),
                 type="text/javascript")
    helper.select_all_buttons(panel)
    panel.br()
    panel.input(type="hidden", name="target", value="%s.visualization" % this_file)
    panel.input(type="submit", name="submit", value="Submit")
    panel.div.close()  # control group
    panel.form.close()
    panel.div.close()
    return panel
开发者ID:sgreenstein,项目名称:pairwise-subspecific-origins,代码行数:29,代码来源:NotInBackgroundApp.py

示例11: encode_html_rows

 def encode_html_rows(rows):
     """ Encode rows into html """
     page = markup.page()
     page.h2("Job Table")
     page.init("Job Table")
     JobTable.make_table(page, rows, header= JobTable.columns)
     return page.__str__()
开发者ID:smoitra87,项目名称:denovo-variant-examples,代码行数:7,代码来源:denovo_helper.py

示例12: displayExtFiles

    def displayExtFiles(self, DB):
        """Display blobs in DB as web page links"""
        files = DB.getExtFilenames()
        print files
        if len(files) == 0:
            return
        items=[]
        for f in files:
            print f, files[f]
            items.append('<a href=%s>%s</a>' %(files[f],f)
                         )
        import markup
        page = markup.page( )
        page.init( title="PEATDB Files Preview",
                   css=( 'one.css' ),
                   header="Preview for project",
                   footer="PEATDB" )
        page.ul( class_='mylist' )
        page.li( items, class_='myitem' )
        page.ul.close()

        filename = '/tmp/prevtemp.html'
        hf = open(filename,'w')
        for c in page.content:
            hf.write(c)
        hf.close()
        import webbrowser
        webbrowser.open(filename, autoraise=1)
        return
开发者ID:shambo001,项目名称:peat,代码行数:29,代码来源:Extfile.py

示例13: generate_html_report

    def generate_html_report(self):
        """
        Generate the html report out of the png files created from csv.
        """
        csv_files = self._fetch_csv_files_from_source_dir()

        page = markup.page()
        page.init(title="Jenkins")
        page.h1("API Performance report", style=self.h1_style)
        page.hr()
        index = 0
        ordered_reports_list = ['NovaAPIService', 'NovaSchedulerService',
                                'NovaComputeService', 'NovaNetworkService',
                                'ServiceLevelReport']
        report_idx = 0
        while report_idx < len(ordered_reports_list):
            for csv_file in csv_files:
                report_name = self._fetch_report_name(csv_file)
                if report_name == ordered_reports_list[report_idx]:
                    self._generate_report_from_csv(csv_file, report_name, page)
                    page.br()
            report_idx += 1

        #write the performance report html file.
        fpath = path.join(self.reports_dir, 'log_analysis_report.html')
        html = open(fpath, 'w')
        html.write(str(page))
        html.close()
        print _("Generated performance report : %s") % fpath
开发者ID:kamalpaad,项目名称:openstack-jmeter,代码行数:29,代码来源:log_analysis_report_generator.py

示例14: indexPage

def indexPage(form):
	""" Main query page """
	panel = markup.page()
	panel.div(style="padding:50px 50px;")
	'''
	for bwtDir in glob.glob('/csbiodata/CEGS3x3BWT/*'):
		panel.h3(bwtDir)
		msbwt = MultiStringBWT.loadBWT(bwtDir)
		break
	'''
	panel.h3("Select Dataset:")
	available = sorted(glob.glob("%s/*/*msbwt.npy" % MSBWTdir))
	panel.div(style="padding:0px 0px 40px 120px;")
	panel.form(action="", method="POST", enctype="multipart/form-data")
	for i, dataset in enumerate(available):
		end = dataset.rfind('/')
		start = dataset.rfind('/', 0, end-1) + 1
		shorten = dataset[start:end]
		panel.input(type="checkbox", name="dataset", value=shorten)
		panel.add(shorten)
		panel.br()
	panel.div.close()

	panel.label("Search Pattern:")
	panel.input(type="text", name="pattern", size="100")
	panel.input(type="hidden", name="target", value="msAllele.Search")
	panel.input(type="submit", name="submit", value="Submit")
	panel.form.close()
	panel.div.close()
	return panel
开发者ID:andrewparkermorgan,项目名称:snoop,代码行数:30,代码来源:msAlleleApp.py

示例15: generate_html_report

 def generate_html_report(self):
     """
     Generate the html report out of the png files created from jtl.
     """
     page = markup.page()
     page.init(title="Jenkins")
     page.h1("Performance report", style=self.h1_style)
     page.hr()
     index = 0
     for plugin,jtl in plugin_class_file_map.items():
         index += 1
         page.h2(plugin, style=self.h2_style)
         if plugin != 'AggregateReport':
             # Aggregate Report will only have tabular report link.                
             #png_path = path.join(self.reports_dir, plugin + ".png")
             png_path = plugin + ".png"
             page.img(src=png_path, alt=plugin)
         page.br()
         #generate tabular report.
         report_path = self.generate_tabular_html_report_for_plugin(plugin)
         if report_path:
             csv_fname = plugin + ".csv"
             page.a("Download csv report", href=csv_fname,
                    style=self.a_style)
             page.a("View csv report", href=report_path, style=self.a_style)
         page.a("Top", href="#top", style=self.a_style)
         page.br()
     #write the performance report html file.
     fpath = path.join(self.reports_dir, 'performance_report.html')
     html = open(fpath, 'w')
     html.write(str(page))
     html.close()
     print "Generated Performance Report : %s" % fpath
开发者ID:kamalpaad,项目名称:openstack-jmeter,代码行数:33,代码来源:jmeter_report_generator.py


注:本文中的markup.page函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。