CoCalc Public Fileswww / cgi-bin / mfd / mfe_source.pyOpen with one click!
Author: William A. Stein
Compute Environment: Ubuntu 18.04 (Deprecated)
1
# mfe_source.py
2
# (c) William Stein, 2003
3
# If the input is valid render the page.
4
5
import mfd, constants
6
7
def Link(source):
8
if source == constants.not_computed:
9
s =""
10
else:
11
if type(source) == type(1):
12
id = source
13
author = "source"
14
else:
15
id = source.get_id()
16
author = source.get_author()
17
sw = source.get_software().get_name()
18
if sw != "":
19
author = author + " (%s)"%sw
20
url="%s/mfe_source_html.py?id=%s"%(constants.CGIROOT,id)
21
js = "onClick=\"window.open('%s','Data Source %s','height=100,width=400');return false\""%(url,author)
22
s=' <a href="%s" %s>%s</a> '%(url,js,author)
23
return s
24
25
def Display_Page(source):
26
title = 'Modular Forms Explorer: Source of Data'
27
link = '<link rel=stylesheet type="text/css" href="/mfd/mfd.css", title="was">'
28
body = '<body class=top>'
29
print '<html><head><title>%s</title>%s</head>'%(title,link)
30
print body
31
print '<h1>%s</h1>'%title
32
print '<center>'
33
print source.HTML()
34
print '</center>'
35
print '</body></html>'
36
37
38