HTML Templates (Sitemesh/Tiles concept) in Python

2006-10-23 Thread Suren
Hello,

I am a newbie to python and web development. I am part of a fairly
simple project and we are trying to identify an efficient way to design
our html pages. The technologies at our disposal are javascript, html
and python for now.

Our pages bear a very standard look. Here is what it looks like.

--
   BANNER
--
| -l1   | <-  -> Logout
| -l2   |---
| -l3   |
| -l4   |  CONTENT
| -l5   |---
|   |  COPYRIGHT
-

l1 through l5 are links that basically target the content page and fill
in. Each page via that link has a python reference to go gather
appropriate data for the content page. We are using frames to do the
banner.html, menu.html (the links page) and the content page.

For the content page, how can we decorate it on top with the back/front
buttons and logout buttons and botton with a copyright in every page.
It seems error prone as well as bad design to scatter this logic in
each content page. Is there a template logic like Sitemesh or Tiles
concept that can decorate a desired page just before show time?

Any other tips to help life easier are appreciated.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: HTML Templates (Sitemesh/Tiles concept) in Python

2006-10-23 Thread Suren

> Python with ? CGI ? FastCGI ? mod_python ? Other ?

We are using mod_python and SSI. We are inheriting some legacy code
that we do not want to mess with at all.

> You shouldn't - unless this is an internal web-based application, not a
> public site. Since your dynamically generating the pages, there's no
> gain using frames - but there are huge drawbacks, for the programmers as
> well as for the visitors.

Although not an internal site, this site is going to be in a controlled
environment. Only a handful of people may access the website.

> There are lot of web templating engines in Python, and most of them
> provide some way to either "extend" an existing template (to fill-in
> page-specific stuffs) or to do server-side-includes-like inclusion of
> common parts. Google for Genshi, Jinja, SimpleTAL, Mighty, Cheetah...

I will look at these and see it works.

>
> > Any other tips to help life easier are appreciated.
>
> Have you considered using one of the existing python web development
> libraries/frameworks? Like Pylons, Turbogears, Django, Spyce, Karigell,
> etc, etc, etc, etc...
>
> My 2 cents...

We have not considered a framework coz the legacy code base has not
included one. We are living in the same source structure and did not
want to introduce a newer dependency. I hope we can find a
non-intrusive library/framework that does its job.


Thanks.

-- 
http://mail.python.org/mailman/listinfo/python-list


Stylesheet not respected

2006-10-24 Thread Suren
I was able to the see weird stylesheet behavior on opera, IE and
mozilla under
mod_python. Here is some python code that exhibited the behavior. I
have the body.css in the same folder as this file and the background is

set to blue. When I access it at http://localhost/test.py, the html
page shows Hello World with no blue background.

If i view source, copy into test.html, launch it in browser, everything

is good. Does the lack of .html extension in the address bar cause
trouble?

from mod_python import apache
def handler(req):
req.content_type = 'text/html'
req.write("""


Hello World



Hello World

""")

If I inline the style, it works fine. Any ideas why this happens?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Stylesheet not respected

2006-10-24 Thread Suren
It was nothing related to python but how my httpd.conf was setup.

My apache conf was set to handle files under this.



When I said href="body.css", it was looking under test\body.css. My
project src was way deeper and I was assuming that it would like for
the css file where the python source is.

I am sure this is a newbie gotcha...


Irmen de Jong wrote:
> Suren wrote:
> > I was able to the see weird stylesheet behavior on opera, IE and
> > mozilla under
> > mod_python.
> [snip]
>
> I'm 99% sure this has nothing to do with Python but is just an error
> in your CSS file. Show the CSS so we might be able to see the problem.
>
> One thing to check for though is that your web server is serving CSS
> files with the correct content type (text/css and not text/plain or
> somthing equally silly).
> 
> --Irmen

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: need help removing 'dev-r0' part from a python package

2015-04-19 Thread suren shrestha
On Monday, April 20, 2015 at 10:00:26 AM UTC+5:45, Chris Angelico wrote:
> On Mon, Apr 20, 2015 at 1:57 PM,   wrote:
> > My package 'webpreview'[https://github.com/ludbek/webpreview] has new 
> > version '1.0.3'. I used 'sdist' to bundle it. Unfortunately it names it 
> > 'webpreview-1.0.3dev-r0.tar.gz' instead of 'webpreview-1.0.3.tar.gz' making 
> > it unsuitable to upload to pypi.
> >
> > What is causing sdist to append 'dev' stuff in the package. The source can 
> > be available in the link above. Thanx for you help.
> 
> I'm not an expert on PyPI uploads, but I'm guessing this might be it:
> 
> https://github.com/ludbek/webpreview/blob/master/setup.cfg
> 
> [egg_info]
> tag_build = dev
> tag_svn_revision = true
> 
> "r0" looks like a Subversion revision identifier, and you're tagging
> it with "dev".
> 
> ChrisA


Thanx ChrisA, I will remove it and see what happens :)
-- 
https://mail.python.org/mailman/listinfo/python-list