From: Steve <unetright.thebas...@xoxy.net>
Date: Sun, 7 Jun 2009 15:17:29 -0700 (PDT)
Local: Sun, Jun 7 2009 6:17 pm
Subject: Re: pyTenjin Feature Requests
Hi Makoto,
Thank you for the updated code. I had an implmentation question about
> s = buf[-1]
I usually try to avoid str.find() in algorithms whenever possible. I
> if s and s.isspace() and s.find("\n") < 0: did some debug logging and it looked like buf[-1] was always some number of spaces or '\n'. Would there ever be a newline inside the middle of the string? If not, I'd like to use: if s and s.isspace() and s[-1] != '\n':
> I think that it is very hard to control indents accurately
I know it is a selfish perspective, but I would really like it if
> in Tenjin approach. To controll them, it is necessary to > parse Python statements and detect block correctly, like > Mako or Django does. But it makes Tenjin more complex and > heavy, so I wouldn't do that. > I'm sorry but I recommend to compromise at some level. Tenjin would detect blocks correctly similar to Mako. Having moved from django to pytenjin for performance reasons, I can understand not wanting slow tenjin down too much. I agree that finding a compromise would be a good thing. May I suggest three aspects of what I would consider an ideal
1) Improve block detection so that blocks could be arbitrarily
2) Disallow inconsistent indenting of a single block level control
3) Generate python code with normalized indentation instead of using
I think these three principals could be accomplished relatively easily
py_parse = re.compile(r'(\s*)<\?py (\s*)(.*?)\?>')
I admit that this only handles single-line <?py> statements with no
I would personally like to see this functionality built-in to tenjin
In a previous email I had mentioned that I used an HTML "compressor"
Thanks,
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||