Re: My .py won't some up for the blient
Bradley Hintze <bradley.h-Jz1LIR1CM+5uo7F/[email protected]> Thu, 24 Jun 2010 10:06:49 -0400
| Newsgroups | gmane.comp.python.mod_python |
|---|---|
| Message-ID | <[email protected]> |
Ok. I re-wrote my destroy_confirm.py script and got the right output
to the client but it seems my styl sheets don't work. when I take the
exact string that I'm returning and save it in an HTML file the style
sheets work. Any ideas why my .py script won't implement my css?
Here is my new destroy_confirm.py;
import HTML_template
def middle():
mid=3D'''\
<center>
<table width =3D 550 cellpadding =3D 10 bgcolor=3Dwhite>
<tr><td><center>This action will delete all your session files.
<tr><td><center>
<form action=3D"destroy_LogOut.psp" method=3D"">
<center><input type=3D"submit" value=3D"Run MolProbity Compare"></center>=
'''
return mid
def show():
html_all =3D HTML_template.start() + middle() + HTML_template.end()
return html_all
Thanks,
Bradley
On Thu, Jun 24, 2010 at 9:37 AM, Bradley Hintze
<bradley.h-Jz1LIR1CM+5uo7F/[email protected]> wrote:
> Hi all,
>
> Newbie question. I was hoping to have template HTML at the beginning
> of my .py script and the end. I can't get it to work. Here is what I
> have.
>
> destroy_confirm.py =3D
>
> import HTML_template
> HTML_template.start()
> '''\
> =A0<center>
> =A0<table width =3D 550 cellpadding =3D 10 bgcolor=3Dwhite>
> =A0 =A0<tr><td><center>This action will delete all your session files.
> =A0 =A0<tr><td><center>
> =A0 =A0 =A0 =A0<form =A0action=3D"destroy_LogOut.psp" method=3D"">
> =A0 =A0 =A0 =A0<center><input type=3D"submit" value=3D"Run MolProbity C=
ompare"></center>'''
> HTML_template.end()
>
>
> HTML_template.py =3D
>
> def start():
> =A0 =A0start=3D '''\
> <html>
> <head>
> <link rel=3D"stylesheet" type=3D"text/css" href=3D"style.css" />
> </head>
> <body>
> =A0<center>
> =A0<table width =3D 1024 cellpadding =3D 10>
> =A0 =A0<tr><td valign =3D top>Molprobity Compare<br /><br /><br />
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<a href =3D"destroy_confirm.psp"=
>Log Off</a>
> =A0 =A0 =A0 =A0<td>
> =A0 =A0 =A0 =A0 =A0 =A0<table width =3D 850 cellpadding =3D 10>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<tr><td colspan =3D 2><center><h1>MolPro=
bity Compare</h1></center>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<tr><td colspan =3D 2>Molprbity Compare =
will allow you
> to compare Molprobity parameters
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for two different structures. Th=
e program will
> highlghit important
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0differences between the two.
> =A0 =A0 =A0 =A0 =A0 =A0</table>
> =A0<hr>
> '''
> =A0 =A0return start
>
> def end():
> =A0 =A0end =3D '''\
> =A0</table>
> =A0</center>
> </body>
> </html>
> '''
> =A0 =A0return end
>
>
> Handlers in httpd.conf =A0=3D
>
> <Directory /Library/WebServer/Documents>
> =A0 =A0AddHandler mod_python .py .psp .psp_
> =A0 =A0<FilesMatch "\.(psp|psp_)$">
> =A0 =A0 =A0 =A0PythonHandler mod_python.psp
> =A0 =A0 =A0 =A0</FilesMatch>
> =A0 =A0 =A0 =A0<Files *.py>
> =A0 =A0 =A0 =A0PythonHandler mod_python.publisher
> =A0 =A0 =A0 =A0</Files>
> =A0 =A0PythonDebug On
> </Directory>
>
> I hope this isn't too much to ask. =A0Any ideas?
>
> --
> Bradley J. Hintze
> Graduate Student
> Duke University
> School of Medicine
> 801-712-8799
>
--=20
Bradley J. Hintze
Graduate Student
Duke University
School of Medicine
801-712-8799