[issue33342] urllib IPv6 parsing fails with special characters in passwords

2019-01-24 Thread Terrence Brannon
Terrence Brannon added the comment: Also note, if SQLAlchemy gives any guidance, then note that SA unquotes both the username and password of the URL: https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/engine/url.py#L274

[issue33342] urllib IPv6 parsing fails with special characters in passwords

2019-01-24 Thread Terrence Brannon
Terrence Brannon added the comment: Regarding "RFC 2396 explicitly excludes the use of [ and ] in URLs. RFC 2732 <https://www.ietf.org/rfc/rfc2732.txt> defines the syntax for IPv6 URLs, and allows [ and ] ONLY in the host part. So I'd say that the behaviour is arguably correct (

[issue33342] urllib IPv6 parsing fails with special characters in passwords

2019-01-23 Thread Terrence Brannon
Terrence Brannon added the comment: I would like to add to this bug - the password field on the URL cannot contain a pound sign or question mark or the parser incorrectly parses the URL, as this gist demonstrates - https://gist.github.com/metaperl/fc6f43bf6b9a9f874b8f27e29695e68c

Re: push-style templating - an xml-like way to process xhtml

2008-11-07 Thread Terrence Brannon
On Nov 2, 6:19 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: Learning the handful of constructs is the same as learning a handful of API calls. The same goes for idiosyncrasies of e.g. inserting sub-templates or dealing with repeating content. I'm not sure I agree with you. 1 - the

Re: is this a good way to do imports ?

2008-11-05 Thread Terrence Brannon
On Nov 5, 2:14 pm, Stef Mientki [EMAIL PROTECTED] wrote: Now I want to be able to use functions of file2 in file1, and vice-versa. It sounds like __all__ in __init__.py would work: http://www.python.org/doc/2.5.2/tut/node8.html#SECTION00840 If not, then pkgutil might of use?

Re: push-style templating - an xml-like way to process xhtml

2008-11-05 Thread Terrence Brannon
On Nov 5, 6:03 am, lkcl [EMAIL PROTECTED] wrote: * pyjamas (http://pyjs.org) - this is treating the web page and the wow. I had never heard of it, but it is _damned_ impressive. THANK YOU. I'm joining the club for my next webdev project! rock on. --

push-style templating - an xml-like way to process xhtml

2008-11-02 Thread Terrence Brannon
Hello, The most common way of dynamically producing HTML is via template engines like genshi, cheetah, makotemplates, etc. These engines are 'inline' --- they intersperse programming constructs with the HTML document itself. An opposite approach to this form of dynamic HTML production is called

Re: push-style templating - an xml-like way to process xhtml

2008-11-02 Thread Terrence Brannon
Tino Wildenhain wrote: An opposite approach to this form of dynamic HTML production is called push-style templating, as coined by Terence Parr: Hm. a href=$attr.url$$attr.title$/a $if(attr.active)$ $attr.submenu:menuItem()$ $endif$ This looks ugly to me. It looks ugly to me too. Why

Re: push-style templating - an xml-like way to process xhtml

2008-11-02 Thread Terrence Brannon
Tino Wildenhain wrote: Terrence Brannon wrote: Tino Wildenhain wrote: An opposite approach to this form of dynamic HTML production is called push-style templating, as coined by Terence Parr: Hm. a href=$attr.url$$attr.title$/a $if(attr.active)$ $attr.submenu:menuItem()$ $endif

Re: code critique requested - just 60 lines

2008-10-03 Thread Terrence Brannon
On Oct 2, 11:56 am, [EMAIL PROTECTED] wrote: Terrence Brannon, I suggest you to shorten a lot some of those very long lines. yes, I wanted to, but was not sure how to continue a line on the next line in Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: code critique requested - just 60 lines

2008-10-03 Thread Terrence Brannon
On Oct 2, 11:09 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Thu, 02 Oct 2008 07:51:30 -0700, Terrence Brannon wrote: Basically, using non-strict dictionary keys can lead to bugs, so that worried me. What's a non-strict dictionary key? In Perl, you can pre-define

how best to use a dictionary in this function?

2008-10-02 Thread Terrence Brannon
Ok, here is some code: def calc_profit(std_clicks, vip_clicks, ad_rate=200, upline_status=None): payout = {} payout_std = std_clicks * rates['std'].per_click payout_vip = vip_clicks * rates['vip'].per_click ... now note that std_clicks and vip_clicks are passed to the function.

code critique requested - just 60 lines

2008-10-02 Thread Terrence Brannon
Hi, I would like some feedback on how you would improve the following program: http://www.bitbucket.org/metaperl/ptc_math/src/21979c65074f/payout.py Basically, using non-strict dictionary keys can lead to bugs, so that worried me. Also, I'm not sure that my code is as crisp and concise as it

re.compile versus r''

2008-08-28 Thread Terrence Brannon
Hello, I'm using a tool (PLY) which apparently expects the tokens to be created using r'' But because one token is a rather complex regular expression, I want to create the regular expression programmatically. How can I generate a string and then create something of the same type that the r''

Re: re.compile versus r''

2008-08-28 Thread Terrence Brannon
Oh my god, how embarrassing. the r'' notation is to create raw string http://www.swc.scipy.org/lec/glossary.html#gdef-raw_string I thought it was some form of blessing a string into a regular expression class. -- http://mail.python.org/mailman/listinfo/python-list

Re: 2d graphics - drawing a vescica piscis in Python

2008-06-18 Thread Terrence Brannon
On Jun 17, 3:45 pm, Terrence Brannon [EMAIL PROTECTED] wrote: Hello, I have written a program to draw a vescica piscis http:// en.wikipedia.org/wiki/Vesica_piscis actually, I mis-spelled the term. It should be vesica piscis or vesica pisces. I put a c after the s -- vescica

2d graphics - drawing a vescica piscis in Python

2008-06-17 Thread Terrence Brannon
Hello, I have written a program to draw a vescica piscis http:// en.wikipedia.org/wiki/Vesica_piscis from turtle import * def main(): setup(width=400, height=400) r = 50 color(black) circle(r) color(white) forward(r) color(black) circle(r) x =

Incremental Progress Report object/closure?

2006-09-01 Thread Terrence Brannon
'lo all, I'm looking for something that gives feedback to the screen every X iterations, reporting Time elapsed: 0:00:00 X,XXX,XXX records done. speed /second. [Action Label] Such a thingy is useful when one is cranking away at million record flat files and one wants to provide feedback