#9315: Keyword arguments with spaces and the url tag
--------------------------------------+-------------------------------------
          Reporter:  alexisbellido    |         Owner:  nessita                 
    
            Status:  assigned         |     Milestone:  1.1                     
    
         Component:  Template system  |       Version:  1.0                     
    
        Resolution:                   |      Keywords:  url, tplrf-fixed, 
pycamp2009
             Stage:  Accepted         |     Has_patch:  1                       
    
        Needs_docs:  0                |   Needs_tests:  0                       
    
Needs_better_patch:  0                |  
--------------------------------------+-------------------------------------
Comment (by nessita):

 Last night, while being unable to sleep, I figured out that the non-greedy
 part of the proposed regular expression (in teh pacth attached) can be
 changed to a greedy expression, improving the performance of it.

 So, where it reads:

 {{{
 smart_split_re = re.compile(r"""(\S*?"(?:[^"\\]*(?:\\.[^"\\]*)*)"\S*| #
 matches '"value with spaces"' and 'keyword="value with spaces"'
                                  \S*?'(?:[^'\\]*(?:\\.[^'\\]*)*)'\S*| #
 same as above but with quotes swapped
                                  \S+)                                 #
 matches not whitespaces""",
                             re.VERBOSE)
 }}}

 the {{{\S+?"}}} can be changed to {{{[^\s"]"}}} (same for the {{{'}}}
 character). I'll submit a new patch in a while, prior some checkings.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9315#comment:6>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to