Changeset 16

Show
Ignore:
Timestamp:
17/08/04 18:13:35 (4 years ago)
Author:
steve
Message:

allow $ at end of line

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/airspeed.py

    r15 r16  
    1010            got = got[:36] + ' ...' 
    1111        Exception.__init__(self,"%s: expected %s, got: %s ..." % (element.__class__.__name__, expected, got)) 
     12 
     13 
    1214class NoMatch(Exception): pass 
    1315 
     
    2123        except KeyError: return self.parent[key] 
    2224 
     25 
    2326class TextElement: 
    24     MY_PATTERN = re.compile(r'^((?:[^\\\$#]|\\[\$#])+|\$[^!\{\}a-z0-9_])(.*)$', re.S + re.I) 
     27    MY_PATTERN = re.compile(r'^((?:[^\\\$#]|\\[\$#])+|\$[^!\{a-z0-9_]|\$$)(.*)$', re.S + re.I) 
    2528    def __init__(self, text): 
    2629        m = self.MY_PATTERN.match(text) 
  • trunk/airspeed_test.py

    r15 r16  
    1818        template = airspeed.Template("Hello $ ") 
    1919        self.assertEquals("Hello $ ", template.merge({})) 
     20        template = airspeed.Template("Hello $") 
     21        self.assertEquals("Hello $", template.merge({})) 
    2022 
    2123    def test_unmatched_name_does_not_get_substituted(self):