Django

Code

Changeset 906

Show
Ignore:
Timestamp:
10/17/05 09:26:41 (3 years ago)
Author:
rjwittams
Message:

Cleanups of old debug bits. Fully clean DebugLexer?.
Reverted some testing changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/new-admin/django/core/management.py

    r854 r906  
    641641        except KeyboardInterrupt: 
    642642            sys.exit(0) 
    643     #from django.utils import autoreload 
    644     #autoreload.main(inner_run) 
    645     inner_run() 
     643    from django.utils import autoreload 
     644    autoreload.main(inner_run) 
     645    #inner_run() 
    646646runserver.args = '[optional port number, or ipaddr:port]' 
    647647 
  • django/branches/new-admin/django/core/meta/__init__.py

    r883 r906  
    16041604 
    16051605def manipulator_save(opts, klass, add, change, self, new_data): 
     1606    # TODO: big cleanup when core fields go -> use recursive manipulators.  
    16061607    from django.utils.datastructures import DotExpandedDict 
    16071608    params = {} 
  • django/branches/new-admin/django/core/template/__init__.py

    r883 r906  
    225225        for match in newline_re.finditer(template_string): 
    226226            yield match.start() 
     227        yield len(template_string) + 1 
    227228 
    228229    def tokenize(self): 
    229230        "Return a list of tokens from a given template_string" 
    230          
    231         token_tups = [] 
    232         upto = 0 
    233         line = 1 
    234         #TODO:Py2.4 generator expression  
    235         linebreaks = self.find_linebreaks(self.template_string) 
    236         next_linebreak = linebreaks.next() 
    237          
    238  
     231        token_tups, upto = [], 0 
     232        lines = enumerate(self.find_linebreaks(self.template_string)) 
     233        line, next_linebreak = lines.next() 
    239234        for match in tag_re.finditer(self.template_string): 
     235            while next_linebreak <= upto: 
     236                line, next_linebreak = lines.next()     
    240237            start, end = match.span() 
    241238            if start > upto:        
    242239                token_tups.append( (self.template_string[upto:start], line) ) 
    243240                upto = start 
    244                  
    245241                while next_linebreak <= upto: 
    246                     try:  
    247                         next_linebreak = linebreaks.next() 
    248                         line += 1 
    249                     except StopIteration: 
    250                         break 
    251              
     242                    line, next_linebreak = lines.next()               
    252243            token_tups.append( (self.template_string[start:end], line) ) 
    253244            upto = end 
    254      
    255             while next_linebreak <= upto: 
    256                 try:  
    257                     next_linebreak = linebreaks.next() 
    258                     line += 1 
    259                 except StopIteration: 
    260                     break 
    261  
    262245        last_bit = self.template_string[upto:] 
    263         if len(last_bit)
     246        if last_bit
    264247           token_tups.append( (last_bit, line) ) 
    265          
    266248        return [ self.create_token(tok, (self.filename, line)) for tok, line in token_tups] 
    267  
    268249 
    269250    def create_token(self, token_string, source): 
  • django/branches/new-admin/django/core/template/loader.py

    r876 r906  
    189189             template_path = resolve_variable(self.template_path_var, context) 
    190190             print "IncludeNode rendering %s" % template_path 
    191              t = template_loader.get_template(template_path) 
     191             t = get_template(template_path) 
    192192             return t.render(context) 
    193193         except Exception, e: 
  • django/branches/new-admin/tests/othertests/templates.py

    r882 r906  
    216216    # Raise exception for custom tags used in child with {% load %} tag in parent, not in child 
    217217    'exception04': ("{% extends 'inheritance17' %}{% block first %}{% echo 400 %}5678{% endblock %}", {}, template.TemplateSyntaxError), 
     218 
     219    'multiline01': (""" 
     220                    Hello, 
     221                    boys. 
     222                    How  
     223                    are  
     224                    you 
     225                    gentlemen.  
     226                    """,  
     227                    {},  
     228                    """ 
     229                    Hello, 
     230                    boys. 
     231                    How  
     232                    are  
     233                    you 
     234                    gentlemen.  
     235                    """  ),  
    218236} 
    219237