Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2109 -- Convert old-style classes to new-style classes through…

…out Django. Thanks, Nicola Larosa

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2abfd5dd586c4f6fb619de561b2194687021e256 1 parent 5edd133
Adrian Holovaty authored June 08, 2006

Showing 33 changed files with 63 additions and 64 deletions. Show diff stats Hide diff stats

  1. 6  django/conf/__init__.py
  2. 2  django/contrib/auth/middleware.py
  3. 2  django/contrib/flatpages/middleware.py
  4. 2  django/contrib/redirects/middleware.py
  5. 2  django/contrib/sessions/middleware.py
  6. 2  django/contrib/syndication/feeds.py
  7. 2  django/core/cache/backends/base.py
  8. 6  django/core/context_processors.py
  9. 2  django/core/handlers/base.py
  10. 2  django/core/paginator.py
  11. 8  django/core/servers/basehttp.py
  12. 2  django/core/urlresolvers.py
  13. 30  django/core/validators.py
  14. 2  django/db/backends/util.py
  15. 2  django/db/models/__init__.py
  16. 2  django/db/models/fields/__init__.py
  17. 4  django/db/models/fields/related.py
  18. 4  django/db/models/options.py
  19. 2  django/db/models/query.py
  20. 8  django/forms/__init__.py
  21. 2  django/middleware/cache.py
  22. 2  django/middleware/common.py
  23. 2  django/middleware/doc.py
  24. 2  django/middleware/gzip.py
  25. 2  django/middleware/http.py
  26. 2  django/middleware/locale.py
  27. 2  django/middleware/transaction.py
  28. 8  django/template/__init__.py
  29. 2  django/template/context.py
  30. 2  django/utils/datastructures.py
  31. 2  django/utils/dateformat.py
  32. 4  django/utils/feedgenerator.py
  33. 3  tests/othertests/templates.py
6  django/conf/__init__.py
@@ -12,7 +12,7 @@
12 12
 
13 13
 ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
14 14
 
15  
-class LazySettings:
  15
+class LazySettings(object):
16 16
     """
17 17
     A lazy proxy for either global Django settings or a custom settings object.
18 18
     The user can manually configure settings prior to using them. Otherwise,
@@ -67,7 +67,7 @@ def configure(self, default_settings=global_settings, **options):
67 67
             setattr(holder, name, value)
68 68
         self._target = holder
69 69
 
70  
-class Settings:
  70
+class Settings(object):
71 71
     def __init__(self, settings_module):
72 72
         # update this dict from global settings (but only for ALL_CAPS settings)
73 73
         for setting in dir(global_settings):
@@ -112,7 +112,7 @@ def __init__(self, settings_module):
112 112
     def get_all_members(self):
113 113
         return dir(self)
114 114
 
115  
-class UserSettingsHolder:
  115
+class UserSettingsHolder(object):
116 116
     """
117 117
     Holder for user configured settings.
118 118
     """
2  django/contrib/auth/middleware.py
@@ -12,7 +12,7 @@ def __get__(self, request, obj_type=None):
12 12
                 self._user = AnonymousUser()
13 13
         return self._user
14 14
 
15  
-class AuthenticationMiddleware:
  15
+class AuthenticationMiddleware(object):
16 16
     def process_request(self, request):
17 17
         assert hasattr(request, 'session'), "The Django authentication middleware requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'."
18 18
         request.__class__.user = LazyUser()
2  django/contrib/flatpages/middleware.py
@@ -2,7 +2,7 @@
2 2
 from django.http import Http404
3 3
 from django.conf import settings
4 4
 
5  
-class FlatpageFallbackMiddleware:
  5
+class FlatpageFallbackMiddleware(object):
6 6
     def process_response(self, request, response):
7 7
         if response.status_code != 404:
8 8
             return response # No need to check for a flatpage for non-404 responses.
2  django/contrib/redirects/middleware.py
@@ -2,7 +2,7 @@
2 2
 from django import http
3 3
 from django.conf import settings
4 4
 
5  
-class RedirectFallbackMiddleware:
  5
+class RedirectFallbackMiddleware(object):
6 6
     def process_response(self, request, response):
7 7
         if response.status_code != 404:
8 8
             return response # No need to check for a redirect for non-404 responses.
2  django/contrib/sessions/middleware.py
@@ -64,7 +64,7 @@ def _get_session(self):
64 64
 
65 65
     _session = property(_get_session)
66 66
 
67  
-class SessionMiddleware:
  67
+class SessionMiddleware(object):
68 68
     def process_request(self, request):
69 69
         request.session = SessionWrapper(request.COOKIES.get(settings.SESSION_COOKIE_NAME, None))
70 70
 
2  django/contrib/syndication/feeds.py
@@ -12,7 +12,7 @@ def add_domain(domain, url):
12 12
 class FeedDoesNotExist(ObjectDoesNotExist):
13 13
     pass
14 14
 
15  
-class Feed:
  15
+class Feed(object):
16 16
     item_pubdate = None
17 17
     item_enclosure_url = None
18 18
     feed_type = feedgenerator.DefaultFeed
2  django/core/cache/backends/base.py
@@ -5,7 +5,7 @@
5 5
 class InvalidCacheBackendError(ImproperlyConfigured):
6 6
     pass
7 7
 
8  
-class BaseCache:
  8
+class BaseCache(object):
9 9
     def __init__(self, params):
10 10
         timeout = params.get('timeout', 300)
11 11
         try:
6  django/core/context_processors.py
@@ -36,7 +36,7 @@ def i18n(request):
36 36
         context_extras['LANGUAGE_CODE'] = request.LANGUAGE_CODE
37 37
     else:
38 38
         context_extras['LANGUAGE_CODE'] = settings.LANGUAGE_CODE
39  
-    
  39
+
40 40
     from django.utils import translation
41 41
     context_extras['LANGUAGE_BIDI'] = translation.get_language_bidi()
42 42
 
@@ -48,7 +48,7 @@ def request(request):
48 48
 # PermWrapper and PermLookupDict proxy the permissions system into objects that
49 49
 # the template system can understand.
50 50
 
51  
-class PermLookupDict:
  51
+class PermLookupDict(object):
52 52
     def __init__(self, user, module_name):
53 53
         self.user, self.module_name = user, module_name
54 54
     def __repr__(self):
@@ -58,7 +58,7 @@ def __getitem__(self, perm_name):
58 58
     def __nonzero__(self):
59 59
         return self.user.has_module_perms(self.module_name)
60 60
 
61  
-class PermWrapper:
  61
+class PermWrapper(object):
62 62
     def __init__(self, user):
63 63
         self.user = user
64 64
     def __getitem__(self, module_name):
2  django/core/handlers/base.py
@@ -3,7 +3,7 @@
3 3
 from django import http
4 4
 import sys
5 5
 
6  
-class BaseHandler:
  6
+class BaseHandler(object):
7 7
     def __init__(self):
8 8
         self._request_middleware = self._view_middleware = self._response_middleware = self._exception_middleware = None
9 9
 
2  django/core/paginator.py
@@ -4,7 +4,7 @@
4 4
 class InvalidPage(Exception):
5 5
     pass
6 6
 
7  
-class ObjectPaginator:
  7
+class ObjectPaginator(object):
8 8
     """
9 9
     This class makes pagination easy. Feed it a QuerySet, plus the number of
10 10
     objects you want on each page. Then read the hits and pages properties to
8  django/core/servers/basehttp.py
@@ -21,7 +21,7 @@
21 21
 class WSGIServerException(Exception):
22 22
     pass
23 23
 
24  
-class FileWrapper:
  24
+class FileWrapper(object):
25 25
     """Wrapper to convert file-like objects to iterables"""
26 26
 
27 27
     def __init__(self, filelike, blksize=8192):
@@ -63,7 +63,7 @@ def _formatparam(param, value=None, quote=1):
63 63
     else:
64 64
         return param
65 65
 
66  
-class Headers:
  66
+class Headers(object):
67 67
     """Manage a collection of HTTP response headers"""
68 68
     def __init__(self,headers):
69 69
         if type(headers) is not ListType:
@@ -218,7 +218,7 @@ def is_hop_by_hop(header_name):
218 218
     """Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header"""
219 219
     return _hoppish(header_name.lower())
220 220
 
221  
-class ServerHandler:
  221
+class ServerHandler(object):
222 222
     """Manage the invocation of a WSGI application"""
223 223
 
224 224
     # Configuration parameters; can override per-subclass or per-instance
@@ -591,7 +591,7 @@ def log_message(self, format, *args):
591 591
             return
592 592
         sys.stderr.write("[%s] %s\n" % (self.log_date_time_string(), format % args))
593 593
 
594  
-class AdminMediaHandler:
  594
+class AdminMediaHandler(object):
595 595
     """
596 596
     WSGI middleware that intercepts calls to the admin media directory, as
597 597
     defined by the ADMIN_MEDIA_PREFIX setting, and serves those images.
2  django/core/urlresolvers.py
@@ -83,7 +83,7 @@ def __call__(self, match_obj):
83 83
             raise NoReverseMatch("Value %r didn't match regular expression %r" % (value, test_regex))
84 84
         return str(value) # TODO: Unicode?
85 85
 
86  
-class RegexURLPattern:
  86
+class RegexURLPattern(object):
87 87
     def __init__(self, regex, callback, default_args=None):
88 88
         # regex is a string representing a regular expression.
89 89
         # callback is something like 'foo.views.news.stories.story_detail',
30  django/core/validators.py
@@ -237,7 +237,7 @@ def hasNoProfanities(field_data, all_data):
237 237
             "Watch your mouth! The words %s are not allowed here.", plural) % \
238 238
             get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in words_seen], 'and')
239 239
 
240  
-class AlwaysMatchesOtherField:
  240
+class AlwaysMatchesOtherField(object):
241 241
     def __init__(self, other_field_name, error_message=None):
242 242
         self.other = other_field_name
243 243
         self.error_message = error_message or lazy_inter(gettext_lazy("This field must match the '%s' field."), self.other)
@@ -247,7 +247,7 @@ def __call__(self, field_data, all_data):
247 247
         if field_data != all_data[self.other]:
248 248
             raise ValidationError, self.error_message
249 249
 
250  
-class ValidateIfOtherFieldEquals:
  250
+class ValidateIfOtherFieldEquals(object):
251 251
     def __init__(self, other_field, other_value, validator_list):
252 252
         self.other_field, self.other_value = other_field, other_value
253 253
         self.validator_list = validator_list
@@ -258,7 +258,7 @@ def __call__(self, field_data, all_data):
258 258
             for v in self.validator_list:
259 259
                 v(field_data, all_data)
260 260
 
261  
-class RequiredIfOtherFieldNotGiven:
  261
+class RequiredIfOtherFieldNotGiven(object):
262 262
     def __init__(self, other_field_name, error_message=gettext_lazy("Please enter something for at least one field.")):
263 263
         self.other, self.error_message = other_field_name, error_message
264 264
         self.always_test = True
@@ -267,7 +267,7 @@ def __call__(self, field_data, all_data):
267 267
         if not all_data.get(self.other, False) and not field_data:
268 268
             raise ValidationError, self.error_message
269 269
 
270  
-class RequiredIfOtherFieldsGiven:
  270
+class RequiredIfOtherFieldsGiven(object):
271 271
     def __init__(self, other_field_names, error_message=gettext_lazy("Please enter both fields or leave them both empty.")):
272 272
         self.other, self.error_message = other_field_names, error_message
273 273
         self.always_test = True
@@ -282,7 +282,7 @@ class RequiredIfOtherFieldGiven(RequiredIfOtherFieldsGiven):
282 282
     def __init__(self, other_field_name, error_message=gettext_lazy("Please enter both fields or leave them both empty.")):
283 283
         RequiredIfOtherFieldsGiven.__init__(self, [other_field_name], error_message)
284 284
 
285  
-class RequiredIfOtherFieldEquals:
  285
+class RequiredIfOtherFieldEquals(object):
286 286
     def __init__(self, other_field, other_value, error_message=None):
287 287
         self.other_field = other_field
288 288
         self.other_value = other_value
@@ -294,7 +294,7 @@ def __call__(self, field_data, all_data):
294 294
         if all_data.has_key(self.other_field) and all_data[self.other_field] == self.other_value and not field_data:
295 295
             raise ValidationError(self.error_message)
296 296
 
297  
-class RequiredIfOtherFieldDoesNotEqual:
  297
+class RequiredIfOtherFieldDoesNotEqual(object):
298 298
     def __init__(self, other_field, other_value, error_message=None):
299 299
         self.other_field = other_field
300 300
         self.other_value = other_value
@@ -306,7 +306,7 @@ def __call__(self, field_data, all_data):
306 306
         if all_data.has_key(self.other_field) and all_data[self.other_field] != self.other_value and not field_data:
307 307
             raise ValidationError(self.error_message)
308 308
 
309  
-class IsLessThanOtherField:
  309
+class IsLessThanOtherField(object):
310 310
     def __init__(self, other_field_name, error_message):
311 311
         self.other, self.error_message = other_field_name, error_message
312 312
 
@@ -314,7 +314,7 @@ def __call__(self, field_data, all_data):
314 314
         if field_data > all_data[self.other]:
315 315
             raise ValidationError, self.error_message
316 316
 
317  
-class UniqueAmongstFieldsWithPrefix:
  317
+class UniqueAmongstFieldsWithPrefix(object):
318 318
     def __init__(self, field_name, prefix, error_message):
319 319
         self.field_name, self.prefix = field_name, prefix
320 320
         self.error_message = error_message or gettext_lazy("Duplicate values are not allowed.")
@@ -324,7 +324,7 @@ def __call__(self, field_data, all_data):
324 324
             if field_name != self.field_name and value == field_data:
325 325
                 raise ValidationError, self.error_message
326 326
 
327  
-class IsAPowerOf:
  327
+class IsAPowerOf(object):
328 328
     """
329 329
     >>> v = IsAPowerOf(2)
330 330
     >>> v(4, None)
@@ -342,7 +342,7 @@ def __call__(self, field_data, all_data):
342 342
         if val != int(val):
343 343
             raise ValidationError, gettext("This value must be a power of %s.") % self.power_of
344 344
 
345  
-class IsValidFloat:
  345
+class IsValidFloat(object):
346 346
     def __init__(self, max_digits, decimal_places):
347 347
         self.max_digits, self.decimal_places = max_digits, decimal_places
348 348
 
@@ -359,7 +359,7 @@ def __call__(self, field_data, all_data):
359 359
             raise ValidationError, ngettext("Please enter a valid decimal number with at most %s decimal place.",
360 360
                 "Please enter a valid decimal number with at most %s decimal places.", self.decimal_places) % self.decimal_places
361 361
 
362  
-class HasAllowableSize:
  362
+class HasAllowableSize(object):
363 363
     """
364 364
     Checks that the file-upload field data is a certain size. min_size and
365 365
     max_size are measurements in bytes.
@@ -379,7 +379,7 @@ def __call__(self, field_data, all_data):
379 379
         if self.max_size is not None and len(content) > self.max_size:
380 380
             raise ValidationError, self.max_error_message
381 381
 
382  
-class MatchesRegularExpression:
  382
+class MatchesRegularExpression(object):
383 383
     """
384 384
     Checks that the field matches the given regular-expression. The regex
385 385
     should be in string format, not already compiled.
@@ -392,7 +392,7 @@ def __call__(self, field_data, all_data):
392 392
         if not self.regexp.search(field_data):
393 393
             raise ValidationError(self.error_message)
394 394
 
395  
-class AnyValidator:
  395
+class AnyValidator(object):
396 396
     """
397 397
     This validator tries all given validators. If any one of them succeeds,
398 398
     validation passes. If none of them succeeds, the given message is thrown
@@ -416,7 +416,7 @@ def __call__(self, field_data, all_data):
416 416
                 pass
417 417
         raise ValidationError(self.error_message)
418 418
 
419  
-class URLMimeTypeCheck:
  419
+class URLMimeTypeCheck(object):
420 420
     "Checks that the provided URL points to a document with a listed mime type"
421 421
     class CouldNotRetrieve(ValidationError):
422 422
         pass
@@ -441,7 +441,7 @@ def __call__(self, field_data, all_data):
441 441
             raise URLMimeTypeCheck.InvalidContentType, gettext("The URL %(url)s returned the invalid Content-Type header '%(contenttype)s'.") % {
442 442
                 'url': field_data, 'contenttype': content_type}
443 443
 
444  
-class RelaxNGCompact:
  444
+class RelaxNGCompact(object):
445 445
     "Validate against a Relax NG compact schema"
446 446
     def __init__(self, schema_path, additional_root_element=None):
447 447
         self.schema_path = schema_path
2  django/db/backends/util.py
... ...
@@ -1,7 +1,7 @@
1 1
 import datetime
2 2
 from time import time
3 3
 
4  
-class CursorDebugWrapper:
  4
+class CursorDebugWrapper(object):
5 5
     def __init__(self, cursor, db):
6 6
         self.cursor = cursor
7 7
         self.db = db
2  django/db/models/__init__.py
@@ -15,7 +15,7 @@
15 15
 # Admin stages.
16 16
 ADD, CHANGE, BOTH = 1, 2, 3
17 17
 
18  
-class LazyDate:
  18
+class LazyDate(object):
19 19
     """
20 20
     Use in limit_choices_to to compare the field to dates calculated at run time
21 21
     instead of when the model is loaded.  For example::
2  django/db/models/fields/__init__.py
@@ -535,7 +535,7 @@ def get_manipulator_fields(self, opts, manipulator, change, name_prefix='', rel=
535 535
         if not self.blank:
536 536
             if rel:
537 537
                 # This validator makes sure FileFields work in a related context.
538  
-                class RequiredFileField:
  538
+                class RequiredFileField(object):
539 539
                     def __init__(self, other_field_names, other_file_field_name):
540 540
                         self.other_field_names = other_field_names
541 541
                         self.other_file_field_name = other_file_field_name
4  django/db/models/fields/related.py
@@ -667,7 +667,7 @@ def contribute_to_related_class(self, cls, related):
@@ -704,7 +704,7 @@ def __init__(self, to, field_name, num_in_admin=0, edit_inline=False,
4  django/db/models/options.py
@@ -15,7 +15,7 @@
15 15
                  'unique_together', 'permissions', 'get_latest_by',
16 16
                  'order_with_respect_to', 'app_label')
17 17
 
18  
-class Options:
  18
+class Options(object):
19 19
     def __init__(self, meta):
20 20
         self.fields, self.many_to_many = [], []
21 21
         self.module_name, self.verbose_name = None, None
@@ -195,7 +195,7 @@ def has_field_type(self, field_type, follow=None):
195 195
                 self._field_types[field_type] = False
196 196
         return self._field_types[field_type]
197 197
 
198  
-class AdminOptions:
  198
+class AdminOptions(object):
199 199
     def __init__(self, fields=None, js=None, list_display=None, list_filter=None,
200 200
         date_hierarchy=None, save_as=False, ordering=None, search_fields=None,
201 201
         save_on_top=False, list_select_related=False, manager=None, list_per_page=100):
2  django/db/models/query.py
@@ -546,7 +546,7 @@ def _clone(self, klass=None, **kwargs):
546 546
         c._order = self._order
547 547
         return c
548 548
 
549  
-class QOperator:
  549
+class QOperator(object):
550 550
     "Base class for QAnd and QOr"
551 551
     def __init__(self, *args):
552 552
         self.args = args
8  django/forms/__init__.py
@@ -101,7 +101,7 @@ def do_html2python(self, new_data):
101 101
         for field in self.fields:
102 102
             field.convert_post_data(new_data)
103 103
 
104  
-class FormWrapper:
  104
+class FormWrapper(object):
105 105
     """
106 106
     A wrapper linking a Manipulator to the template system.
107 107
     This allows dictionary-style lookups of formfields. It also handles feeding
@@ -150,7 +150,7 @@ def _get_fields(self):
150 150
 
151 151
     fields = property(_get_fields)
152 152
 
153  
-class FormFieldWrapper:
  153
+class FormFieldWrapper(object):
154 154
     "A bridge between the template system and an individual form field. Used by FormWrapper."
155 155
     def __init__(self, formfield, data, error_list):
156 156
         self.formfield, self.data, self.error_list = formfield, data, error_list
@@ -211,7 +211,7 @@ def has_errors(self):
211 211
     def html_combined_error_list(self):
212 212
         return ''.join([field.html_error_list() for field in self.formfield_dict.values() if hasattr(field, 'errors')])
213 213
 
214  
-class InlineObjectCollection:
  214
+class InlineObjectCollection(object):
215 215
     "An object that acts like a sparse list of form field collections."
216 216
     def __init__(self, parent_manipulator, rel_obj, data, errors):
217 217
         self.parent_manipulator = parent_manipulator
@@ -269,7 +269,7 @@ def fill(self):
269 269
             self._collections = collections
270 270
 
271 271
 
272  
-class FormField:
  272
+class FormField(object):
273 273
     """Abstract class representing a form field.
274 274
 
275 275
     Classes that extend FormField should define the following attributes:
2  django/middleware/cache.py
@@ -3,7 +3,7 @@
3 3
 from django.utils.cache import get_cache_key, learn_cache_key, patch_response_headers
4 4
 from django.http import HttpResponseNotModified
5 5
 
6  
-class CacheMiddleware:
  6
+class CacheMiddleware(object):
7 7
     """
8 8
     Cache middleware. If this is enabled, each Django-powered page will be
9 9
     cached for CACHE_MIDDLEWARE_SECONDS seconds. Cache is based on URLs.
2  django/middleware/common.py
@@ -3,7 +3,7 @@
3 3
 from django.core.mail import mail_managers
4 4
 import md5, os
5 5
 
6  
-class CommonMiddleware:
  6
+class CommonMiddleware(object):
7 7
     """
8 8
     "Common" middleware for taking care of some basic operations:
9 9
 
2  django/middleware/doc.py
... ...
@@ -1,7 +1,7 @@
1 1
 from django.conf import settings
2 2
 from django import http
3 3
 
4  
-class XViewMiddleware:
  4
+class XViewMiddleware(object):
5 5
     """
6 6
     Adds an X-View header to internal HEAD requests -- used by the documentation system.
7 7
     """
2  django/middleware/gzip.py
@@ -4,7 +4,7 @@
4 4
 
5 5
 re_accepts_gzip = re.compile(r'\bgzip\b')
6 6
 
7  
-class GZipMiddleware:
  7
+class GZipMiddleware(object):
8 8
     """
9 9
     This middleware compresses content if the browser allows gzip compression.
10 10
     It sets the Vary header accordingly, so that caches will base their storage
2  django/middleware/http.py
... ...
@@ -1,6 +1,6 @@
1 1
 import datetime
2 2
 
3  
-class ConditionalGetMiddleware:
  3
+class ConditionalGetMiddleware(object):
4 4
     """
5 5
     Handles conditional GET operations. If the response has a ETag or
6 6
     Last-Modified header, and the request has If-None-Match or
2  django/middleware/locale.py
@@ -3,7 +3,7 @@
3 3
 from django.utils.cache import patch_vary_headers
4 4
 from django.utils import translation
5 5
 
6  
-class LocaleMiddleware:
  6
+class LocaleMiddleware(object):
7 7
     """
8 8
     This is a very simple middleware that parses a request
9 9
     and decides what translation object to install in the current
2  django/middleware/transaction.py
... ...
@@ -1,7 +1,7 @@
1 1
 from django.conf import settings
2 2
 from django.db import transaction
3 3
 
4  
-class TransactionMiddleware:
  4
+class TransactionMiddleware(object):
5 5
     """
6 6
     Transaction middleware. If this is enabled, each view function will be run
7 7
     with commit_on_response activated - that way a save() doesn't do a direct
8  django/template/__init__.py
@@ -134,7 +134,7 @@ def __init__(self, source):
134 134
     def reload(self):
135 135
         return self.source
136 136
 
137  
-class Template:
  137
+class Template(object):
138 138
     def __init__(self, template_string, origin=None):
139 139
         "Compilation stage"
140 140
         if settings.TEMPLATE_DEBUG and origin == None:
@@ -158,7 +158,7 @@ def compile_string(template_string, origin):
158 158
     parser = parser_factory(lexer.tokenize())
159 159
     return parser.parse()
160 160
 
161  
-class Token:
  161
+class Token(object):
162 162
     def __init__(self, token_type, contents):
163 163
         "The token_type must be TOKEN_TEXT, TOKEN_VAR or TOKEN_BLOCK"
164 164
         self.token_type, self.contents = token_type, contents
@@ -376,7 +376,7 @@ def parser_factory(*args, **kwargs):
376 376
     else:
377 377
         return Parser(*args, **kwargs)
378 378
 
379  
-class TokenParser:
  379
+class TokenParser(object):
380 380
     """
381 381
     Subclass this and implement the top() method to parse a template line. When
382 382
     instantiating the parser, pass in the line from the Django template parser.
@@ -654,7 +654,7 @@ def resolve_variable(path, context):
654 654
             del bits[0]
655 655
     return current
656 656
 
657  
-class Node:
  657
+class Node(object):
658 658
     def render(self, context):
659 659
         "Return the node rendered as a string"
660 660
         pass
2  django/template/context.py
@@ -7,7 +7,7 @@ class ContextPopException(Exception):
7 7
     "pop() has been called more times than push()"
8 8
     pass
9 9
 
10  
-class Context:
  10
+class Context(object):
11 11
     "A stack container for variable context"
12 12
     def __init__(self, dict_=None):
13 13
         dict_ = dict_ or {}
2  django/utils/datastructures.py
... ...
@@ -1,4 +1,4 @@
1  
-class MergeDict:
  1
+class MergeDict(object):
2 2
     """
3 3
     A simple class for creating new "virtual" dictionaries that actualy look
4 4
     up values in more than one dictionary, passed in the constructor.
2  django/utils/dateformat.py
@@ -19,7 +19,7 @@
19 19
 re_formatchars = re.compile(r'(?<!\\)([aABdDfFgGhHiIjlLmMnNOPrsStTUwWyYzZ])')
20 20
 re_escaped = re.compile(r'\\(.)')
21 21
 
22  
-class Formatter:
  22
+class Formatter(object):
23 23
     def format(self, formatstr):
24 24
         pieces = []
25 25
         for i, piece in enumerate(re_formatchars.split(formatstr)):
4  django/utils/feedgenerator.py
@@ -36,7 +36,7 @@ def get_tag_uri(url, date):
36 36
     tag = re.sub('#', '/', tag)
37 37
     return 'tag:' + tag
38 38
 
39  
-class SyndicationFeed:
  39
+class SyndicationFeed(object):
40 40
     "Base class for all syndication feeds. Subclasses should provide write()"
41 41
     def __init__(self, title, link, description, language=None, author_email=None,
42 42
             author_name=None, author_link=None, subtitle=None, categories=None,
@@ -108,7 +108,7 @@ def latest_post_date(self):
108 108
         else:
109 109
             return datetime.datetime.now()
110 110
 
111  
-class Enclosure:
  111
+class Enclosure(object):
112 112
     "Represents an RSS enclosure"
113 113
     def __init__(self, url, length, mime_type):
114 114
         "All args are expected to be Python Unicode objects"
3  tests/othertests/templates.py
@@ -169,8 +169,7 @@ def method(self):
169 169
     'comment-tag05': ("foo{% comment %} {% somerandomtag %} {% endcomment %}", {}, "foo"),
170 170
 
171 171
     ### CYCLE TAG #############################################################
172  
-    #'cycleXX': ('', {}, ''),
173  
-    'cycle01': ('{% cycle a, %}', {}, 'a'),
  172
+    'cycle01': ('{% cycle a %}', {}, template.TemplateSyntaxError),
174 173
     'cycle02': ('{% cycle a,b,c as abc %}{% cycle abc %}', {}, 'ab'),
175 174
     'cycle03': ('{% cycle a,b,c as abc %}{% cycle abc %}{% cycle abc %}', {}, 'abc'),
176 175
     'cycle04': ('{% cycle a,b,c as abc %}{% cycle abc %}{% cycle abc %}{% cycle abc %}', {}, 'abca'),

0 notes on commit 2abfd5d

Please sign in to comment.
Something went wrong with that request. Please try again.