Changeset 906
- Timestamp:
- 10/17/05 09:26:41 (3 years ago)
- Files:
-
- django/branches/new-admin/django/core/management.py (modified) (1 diff)
- django/branches/new-admin/django/core/meta/__init__.py (modified) (1 diff)
- django/branches/new-admin/django/core/template/__init__.py (modified) (1 diff)
- django/branches/new-admin/django/core/template/loader.py (modified) (1 diff)
- django/branches/new-admin/tests/othertests/templates.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/new-admin/django/core/management.py
r854 r906 641 641 except KeyboardInterrupt: 642 642 sys.exit(0) 643 #from django.utils import autoreload644 #autoreload.main(inner_run)645 inner_run()643 from django.utils import autoreload 644 autoreload.main(inner_run) 645 #inner_run() 646 646 runserver.args = '[optional port number, or ipaddr:port]' 647 647 django/branches/new-admin/django/core/meta/__init__.py
r883 r906 1604 1604 1605 1605 def manipulator_save(opts, klass, add, change, self, new_data): 1606 # TODO: big cleanup when core fields go -> use recursive manipulators. 1606 1607 from django.utils.datastructures import DotExpandedDict 1607 1608 params = {} django/branches/new-admin/django/core/template/__init__.py
r883 r906 225 225 for match in newline_re.finditer(template_string): 226 226 yield match.start() 227 yield len(template_string) + 1 227 228 228 229 def tokenize(self): 229 230 "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() 239 234 for match in tag_re.finditer(self.template_string): 235 while next_linebreak <= upto: 236 line, next_linebreak = lines.next() 240 237 start, end = match.span() 241 238 if start > upto: 242 239 token_tups.append( (self.template_string[upto:start], line) ) 243 240 upto = start 244 245 241 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() 252 243 token_tups.append( (self.template_string[start:end], line) ) 253 244 upto = end 254 255 while next_linebreak <= upto:256 try:257 next_linebreak = linebreaks.next()258 line += 1259 except StopIteration:260 break261 262 245 last_bit = self.template_string[upto:] 263 if l en(last_bit):246 if last_bit: 264 247 token_tups.append( (last_bit, line) ) 265 266 248 return [ self.create_token(tok, (self.filename, line)) for tok, line in token_tups] 267 268 249 269 250 def create_token(self, token_string, source): django/branches/new-admin/django/core/template/loader.py
r876 r906 189 189 template_path = resolve_variable(self.template_path_var, context) 190 190 print "IncludeNode rendering %s" % template_path 191 t = template_loader.get_template(template_path)191 t = get_template(template_path) 192 192 return t.render(context) 193 193 except Exception, e: django/branches/new-admin/tests/othertests/templates.py
r882 r906 216 216 # Raise exception for custom tags used in child with {% load %} tag in parent, not in child 217 217 '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 """ ), 218 236 } 219 237
