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


Python style.header函数代码示例

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


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

示例1: Main

def Main():
	form = cgi.FormContent()
	try:
		secs = form["secs"][0]
	except:
		secs = "nill"
	
	style.header("Data Viewer","white")

	files = os.listdir(DATA_DIR)
	files.sort()

	print '<TABLE><TR><TD>'
	print '<H3>Pick Day:</H3>'
	print '<form method="POST" action="browser.py">'
	print '<SELECT name="secs" size="20">'
	for file in files:
		mkoption(file)
	print '</SELECT><BR>'
	print '<input type="SUBMIT">'
	print '</form></TD>'
	print '<TD>'
	if secs != "nill":	
		mkdata(secs)
	print '</TD>'
	print '</TR></TABLE>'

	print '<a href="/admin">Admin Page</a>'		
开发者ID:akrherz,项目名称:pals,代码行数:28,代码来源:browser.py

示例2: Main

def Main():
	form = cgi.FormContent()
	style.header("Edit Hourly Reports","white")
	style.std_top("Edit Hourly Reports")


	print '<B>Information:</B> <dd>This is the date and time selection page for the Severe Forecasting Excercise.</dd><BR>'
	print '<B>Instruction:</B> <dd>Select the desired day and time and then click on "submit."</dd><BR>'
	print '<B>Scope of this program:</B> <dd>This set of programs modifies ALL of the hourly annotations available to ALL excercises.</dd><BR>'
	print '<B>NOTE:</b><dd>If you are wanting to edit the preview for a case, you will want to edit the first hour that the exercise runs for.</dd>'
	print '<HR>'

	if form.has_key("caseNum"):
		print """
		<HR>
		<a href="hourly.py">Select a different Case</a><BR><HR>"""

		print '<form method="post" action="editHourly.py">'
		print '<input type="hidden" value="'+form["caseNum"][0]+'" name="caseNum">'
		listHours( form["caseNum"][0] )
	else:
		print '<form method="post" action="hourly.py">'
		listCases()

	print '<input type="submit" value="submit">'

	print '<HR>Links outta here:<HR>'
	print '<BR><a href="/admin">Admin Page</a>'	
开发者ID:akrherz,项目名称:pals,代码行数:28,代码来源:hourly.py

示例3: Main

def Main(): 
	form = FormContent()
 	if not form.has_key("url"): style.SendError("CGI ERROR")
	url = form["url"][0]


	style.header("Save Location","white")
	style.std_top("Save the file location")
        print '<a href="http://www.pals.iastate.edu/c2w/adm/search.html">New Search</a>--'
        print '<a href="http://www.pals.iastate.edu/c2w/adm/access.html">Enter a different username</a>'
        print '<HR>'

        mytime = os.popen('date', 'r').read()

	print '<form method=POST action="http://www.pals.iastate.edu/cgi-bin/C2W/prevsub.py">'
        print '<input type="hidden" name="url" value="'+url+'">'
	print '<table>'
	print '<tr>'
        print '<th align="right">Enter your username'
        print '<td><input type="text" name="user">'
	print '<tr>'
	print '<th align="right">Name the file for future reference:'
	print '<td><input type="text" name="title">'
	print '<tr>'
        print '<th align="right">'
        print '<td><input type="hidden" value="'+mytime+'" name="mytime">'
	print '<tr>'
	print '<th colspan=2 align="center">'
	print '<input type="submit" value="Submit">'
	print '</form>'	

        print '</table>\n'
	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:33,代码来源:prev.py

示例4: Main

def Main():
	form = cgi.FormContent()
	file = form["file"][0]

	style.header(file, "white")

	test = os.path.split(file)
	
	if test[1][:3] == "dew":
		print '<H3 align="center">Dew Point Chart</H3>'
		print '<a href="/archivewx/help/dewp.html">Click for help with this Map</a><BR><BR>'

	elif test[1][:3] == "sfc":
		print '<H3 align="center">Surface Chart</H3>'
		print '<a href="/archivewx/help/sfcmap.html">Click for help with this Map</a><BR><BR>'		

	elif test[1][:4] == "temp":
		print '<H3 align="center">Surface Temperature Chart</H3>'
		print '<a href="/archivewx/help/temp.html">Click for help with this Map</a><BR><BR>'

	elif test[1][:3] == "NAT":
		print '<H3 align="center">National Radar</H3>'
		print '<a href="/archivewx/help/radar.html">Click for help with this Map</a><BR><BR>'

	print '<a href="javascript:history.go(-1)">Go Back..</a><BR><BR>'

	print '<IMG SRC="'+file+'">'

	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:29,代码来源:picture.py

示例5: Main

def Main():
	checker()
	style.header("Your Score","/images/ISU_bkgrnd.gif")
	style.std_top("Your Sample Forecast Score")
	score = get_score()
	body(score)	
	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:7,代码来源:grade.py

示例6: Main

def Main():
	form = FormContent()
	year = form["year"][0]
	month = form["month"][0]
	str_month = convert_month("0"+month)
	day = form["day"][0]
	city = form["city"][0]
	station = convert_station(city)
	style.header("IOWAWX Query results","white")
	style.std_top("Data for "+station+" on "+str_month+" "+day+" "+year+".")

	date = str_month+" "+day+", "+year

	high, low, rain, snow = query_db(city, year, month, day)
	sun_type = sun(int(high), int(low))
	high, low, rain, snow  = chk_data(high, low, rain, snow)


	table_header()

	result_table(date, sun_type, str(high), str(low), str(rain), str(snow))

	print '</TABLE>'

	print high, low, rain, snow, sun_type
开发者ID:akrherz,项目名称:pals,代码行数:25,代码来源:result.py

示例7: Main

def Main():
	style.header("Forecasting Results","white")
	form = cgi.FormContent()
	class_name = form["class_name"][0]
	yeer = form["yeer"][0]
	month = form["month"][0]
	day = form["day"][0]

	print '<H3>'+class_name+' : Forecasting Results</H3>'
	print '<BR>Year: '+yeer+'<BR>'
	print 'Month: '+month+'<BR>'
	print 'Day: '+day+'<BR>'

	entries = mydb.query("SELECT * from grades WHERE yeer = '"+yeer+"' and month = '"+month+"' and day = '"+day+"' and userid ~* '"+class_name+"' or userid = 'mos' ").getresult()

	entries = mysort(entries, -1)
	print '<TABLE><TR>'
	print  '<TH>USERID</TH><TH>DM H:</TH><TH>DM L:</TH><TH>DM P:</TH><TH>DM S:</TH><TH>FL H:</TH><TH>FL L:</TH><TH>FL P:</TH><TH>FL S:</TH><TH>TOT:</TH></TR>'

	spacer = " "
        for i in range(len(entries)):
		print '<TR><TD>'
                this_entry = entries[i]
                print this_entry[0] +"</TD>"
                for j in range(len(this_entry)):
			thi = this_entry[j]
			entry = str(thi)
                        if entry[0] == "m" or j == 1 or j == 2 or j == 3:
                                doy = "nothing"
                        else:
                                print '<TD align="center">'+entry+'</TD>', 
                print '</TR>'
	print '</TABLE>'
开发者ID:akrherz,项目名称:pals,代码行数:33,代码来源:results.py

示例8: svrTop

def svrTop(secs_tuple, secs = 0):
        if secs != 0:
                if secs_tuple[-1] == 1:
                        secs = int(secs) - 5*3600
                else:
                        secs = int(secs) - 6*3600
                now_tuple = time.localtime( secs )
                date_str = time.strftime("%B %d, %Y", now_tuple)
                time_str = time.strftime("%I:%M %p [%Z]", now_tuple)+'&nbsp;&nbsp; ( '+str(secs_tuple[3])+' Z )'
        else:
                date_str = "Welcome!!"
                time_str = ""

        style.header("Severe Weather Forecasting Exercise", "white")

        print """
        <TABLE width="100%">
        <TR>
        <TD>
                <img src="/icons/svrTop.gif">
        </TD>
        <TD>
                <TABLE width="100%">
                <TR><TD background="/icons/sidebg.gif" align="CENTER" NOWRAP>
                        <font size="+3" color="white">Current Date & Time:</font>
                </TD></TR>
                <TR><TD bgcolor="white" align="CENTER" NOWRAP>
        """
        print '<font color="blue" size="+2">'+date_str+'</font><BR>'
        print '<font color="red" size="+2">'+time_str+'</font>'
        print """
开发者ID:akrherz,项目名称:pals,代码行数:31,代码来源:svrFrcst.py

示例9: Main

def Main():
	form = cgi.FormContent()
	try:
		email = form["email"][0]
		full_name = form["full_name"][0]
		passwd1 = form["passwd1"][0]
		passwd2 = form["passwd2"][0]
		class_name = form["class_name"][0]
	except:
		style.SendError("CGI Parse Error")

	if passwd1 != passwd2:
		style.SendError("Your passwd is not valid, Try again.")

	email = re.split("@", email)
	userid = class_name+"_"+email[0]

	users = mydb.query("SELECT * from users WHERE userid = '"+userid+"' ").getresult()

	if len(users) > 0:
		style.SendError("Your username is allready taken")

	entre = mydb.query("INSERT into users values ('"+userid+"', '"+full_name+"', '"+passwd1+"' ) ")

	style.header("Username Results.", "white")

	print full_name +'<BR><BR>'
	print 'You have been assigned this userid : '+userid+' <BR><BR>'
	print 'You have been assigned this password : '+passwd1+' <BR><BR>'

	print '<P>You now have an account with the forecasting system, you are free to make forecasts.  Just remember your password :) '

	print '<BR><a href="/frcst/"> Go back to the Forecasting main page</a><BR>'
开发者ID:akrherz,项目名称:pals,代码行数:33,代码来源:enter_user.py

示例10: Main

def Main():
	style.header("Edit Annotation","white")

	form = cgi.FormContent()
	try:
		caseNum = form["caseNum"][0]
		className = form["className"][0]
	except:
		style.SendError("CGI Parse Error")

	entry = get_entry(caseNum, className)

	try:
		comment = entry[0][0]
	except IndexError:
		comment = "Write Something here"

	style.std_top('Edit entry for '+caseNum)
	print '<HR>'
	print '<a href="index.py?className='+className+'">Select a different Case</a><BR>'

        print '<form method="post" action="change.py">'
        print '<input type="hidden" name="className" value="'+className+'">'
	print '<input type="hidden" name="caseNum" value="'+str(caseNum)+'">'
	adds(comment)
	print '<input type="submit" value="Click to Save this Entry">'
	print '</form>'

	
	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:30,代码来源:edit.py

示例11: Main

def Main():
	form = cgi.FormContent()
	file = form["file"][0]

	style.header(file, "white")

	print '<P align="right">'
	print '<a href="#" onClick="top.close();return false;"><img src="/gen/header.php?label=Close%20Window&font_size=20" border="0"></a>'

	test = os.path.split(file)
	
	if test[1][:3] == "dew":
		print '<H3 align="center">Dew Point Chart</H3>'
		print '<a href="/archivewx/help/dewp.html">Click for help with this Map</a><BR><BR>'

	elif test[1][:3] == "sfc":
		print '<H3 align="center">Surface Chart</H3>'
		print '<a href="/archivewx/help/sfcmap.html">Click for help with this Map</a><BR><BR>'		

	elif test[1][:4] == "temp":
		print '<H3 align="center">Surface Temperature Chart</H3>'
		print '<a href="/archivewx/help/temp.html">Click for help with this Map</a><BR><BR>'

	elif test[1][:3] == "NAT":
		print '<H3 align="center">National Radar</H3>'
		print '<a href="/archivewx/help/radar.html">Click for help with this Map</a><BR><BR>'


	print '<BR><IMG SRC="'+file+'">'

	print '<BR><P align="right">'
	print '<a href="#" onClick="top.close();return false;"><img src="/gen/header.php?label=Close%20Window&font_size=20" border="0"></a>'

	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:34,代码来源:picture2.py

示例12: Main

def Main():
	style.header("Restrict / Allow Access to C2W","white")
	form = FormContent()
	if form.has_key('cwd'):
		cwd = form["cwd"][0]
		rtotal = int(form["rtotal"][0])
		utotal = int(form["utotal"][0])
		for i in range(rtotal + 1):
			i = str(i)
			if form["rfile"+i][0] == "n":
				change_to_u(form["rfile"+i+"name"][0])

		for j in range(utotal + 1):
			j = str(j)
			if utotal == "0": break
			if form["ufile"+j][0] == "y":
				change_to_r(form["ufile"+j+"name"][0])


	if form.has_key('dir'): 
		print '<form method="POST" action="restrict.py">'
		dir_loader(form["dir"][0])
		print '<BR clear="all"><HR><HR>'
		print '<input type="submit" value="Make Changes">'
		print '<input type="reset">'
		print '</form>'
	else:
		make_dirs()
开发者ID:akrherz,项目名称:pals,代码行数:28,代码来源:restrict.py

示例13: Main

def Main():
    style.header("7/18/98 Answers", "/images/ISU_bkgrnd.gif")
    style.std_top("June 18, 1998 Answers")
    style.table_setter("400", "State", "Severe Weather type", "During time period")
    table()
    body()
    sys.exit(0)
开发者ID:akrherz,项目名称:pals,代码行数:7,代码来源:answers.py

示例14: Main

def Main():
	style.header('Edit COMET keywords',"white")
	print '<H2 align="center">COMET Keywords editor</H2>'
	form = FormContent()
	if form.has_key("option"):
		option = form["option"][0]
		if option == "delete":
			delete_word(form["keyword"][0])
			actions("Deleted keyword '"+form["keyword"][0]+"'")
			words()
		if option == "change":
			delete_word(form["keyword"][0])
			changer(form["keyword"][0])
		if option == "change2":
			insert(form["keyword"][0])
			actions("Inserted keyword '"+form["keyword"][0]+"'")
			words()
		if option == "add":
			changer("Enter Word Here")
	else:
		actions("Nothing done")
		words()



	style.std_bot()
开发者ID:akrherz,项目名称:pals,代码行数:26,代码来源:keywords.py

示例15: setup_html

def setup_html():
	style.header("Archived Weather Data Search","white")
	print '<table border="0" cellspacing="0" rowspacing="0" width="600">'
	print '<tr><td width="150"></td><td width="450"></td></tr>'
	print '<tr><td bgcolor="#00fcf8" colspan="2">'
	print '<img src="/images/pals_logo.gif" align="left"><spacer type="vertical" size="30">'
	print '<H1>Archive Weather Data Search</H1></td></tr>'
开发者ID:akrherz,项目名称:pals,代码行数:7,代码来源:search.py


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