Commits

Ollie Rutherfurd committed 6bc650e

fix nits

Comments (0)

Files changed (1)

     'year':  r'\d{4}',
     # these defined for the pattern, not name
     # ex: <month:mon>
-    'mon': r'[a-z]{3}', # jan, feb, etc...
-    'n': r'\d+',        # n=number
+    'mon':   r'[a-z]{3}', # jan, feb, etc...
+    'n':     r'\d+',      # n=number
 }
 
 # <name[:pattern]>
 class URLPatternGenerator(object):
     def __init__(self, patterns=None, default=r'\d+',
                  append_slash=True, anchor=True, terminate=True):
-        self.patterns = patterns or PATTERNS
+        self.patterns = patterns or dict(PATTERNS.items())
         self.default = default              # default pattern
         self.append_slash = append_slash    # trailing /
         self.anchor = anchor                # prepend ^
         # special-case so '^$' doesn't end up with a '/' in it
         if url and kw.get('append_slash', self.append_slash) and r[-1:] not in ('$','/'):
             r += '/'
-        if kw.get('terminate',self.terminate) and r[-1:] != '$':
+        if kw.get('terminate', self.terminate) and r[-1:] != '$':
             r += '$'
         return r