Merge lp:~ricardokirkner/django-configglue/rename-configglue-options into lp:django-configglue

Proposed by Ricardo Kirkner
Status: Merged
Approved by: Ricardo Kirkner
Approved revision: 48
Merged at revision: 47
Proposed branch: lp:~ricardokirkner/django-configglue/rename-configglue-options
Merge into: lp:django-configglue
Diff against target: 894 lines (+188/-188)
4 files modified
debian/control (+1/-1)
django_configglue/schema.py (+174/-174)
django_configglue/tests/test_configglue.py (+12/-12)
setup.py (+1/-1)
To merge this branch: bzr merge lp:~ricardokirkner/django-configglue/rename-configglue-options
Reviewer Review Type Date Requested Status
Ricardo Kirkner Approve
Review via email: mp+65597@code.launchpad.net

Commit message

Track option and section class name rename occurring in configglue 0.11

Description of the change

Overview
========

Track Option instances rename occurring in the latest configglue trunk.

To post a comment you must log in.
48. By Ricardo Kirkner

make sure to depend on a recent enough version of configglue

Revision history for this message
Ricardo Kirkner (ricardokirkner) wrote :

This is a boring change, just renames.

This work is part of the preparation for the upcoming 0.5 release.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2011-01-14 12:24:17 +0000
3+++ debian/control 2011-06-23 19:15:58 +0000
4@@ -15,7 +15,7 @@
5 Package: python-django-configglue
6 Architecture: all
7 Depends: ${misc:Depends}, ${python:Depends},
8- python-configglue (>= 0.9.1),
9+ python-configglue (> 0.10),
10 python-django (>= 1.0.2)
11 Description: Django commands for working with configglue generated settings
12 Django-configglue provides the necessary glue to work with settings
13
14=== modified file 'django_configglue/schema.py'
15--- django_configglue/schema.py 2011-04-15 20:50:11 +0000
16+++ django_configglue/schema.py 2011-06-23 19:15:58 +0000
17@@ -4,14 +4,14 @@
18 from copy import deepcopy
19
20 from configglue.pyschema.schema import (
21- BoolConfigOption,
22- ConfigSection,
23- DictConfigOption,
24- IntConfigOption,
25- LinesConfigOption,
26+ BoolOption,
27+ Section,
28+ DictOption,
29+ IntOption,
30+ ListOption,
31 Schema,
32- StringConfigOption,
33- TupleConfigOption,
34+ StringOption,
35+ TupleOption,
36 )
37 from django import get_version
38
39@@ -22,10 +22,10 @@
40 gettext_noop = lambda s: s
41
42
43-class UpperCaseDictConfigOption(DictConfigOption):
44- """ A DictConfigOption with all upper-case keys. """
45+class UpperCaseDictOption(DictOption):
46+ """ A DictOption with all upper-case keys. """
47 def parse(self, section, parser=None, raw=False):
48- parsed = super(UpperCaseDictConfigOption, self).parse(
49+ parsed = super(UpperCaseDictOption, self).parse(
50 section, parser, raw)
51 result = {}
52 for k, v in parsed.items():
53@@ -37,41 +37,41 @@
54 version = '1.0.2 final'
55
56 # Sections
57- django = ConfigSection('django')
58+ django = Section('django')
59
60 ################
61 # CORE #
62 ################
63
64- django.debug = BoolConfigOption(default=True)
65- django.template_debug = BoolConfigOption(default=True)
66- django.debug_propagate_exceptions = BoolConfigOption(default=False,
67+ django.debug = BoolOption(default=True)
68+ django.template_debug = BoolOption(default=True)
69+ django.debug_propagate_exceptions = BoolOption(default=False,
70 help="Whether the framework should propagate raw exceptions rather "
71 "than catching them. This is useful under some testing "
72 "situations and should never be used on a live site.")
73
74- django.use_etags = BoolConfigOption(default=False,
75+ django.use_etags = BoolOption(default=False,
76 help="Whether to use the 'Etag' header. This saves bandwidth but "
77 "slows down performance.")
78
79- django.admins = LinesConfigOption(item=TupleConfigOption(2), default=[],
80+ django.admins = ListOption(item=TupleOption(2), default=[],
81 help="People who get code error notifications. In the format "
82 "(('Full Name', 'email@domain.com'), "
83 "('Full Name', 'anotheremail@domain.com'))")
84
85- django.internal_ips = TupleConfigOption(default=(),
86+ django.internal_ips = TupleOption(default=(),
87 help="Tuple of IP addresses, as strings, that see debug comments, "
88 "when DEBUG is true and receive x-headers")
89
90- django.time_zone = StringConfigOption(default='America/Chicago',
91+ django.time_zone = StringOption(default='America/Chicago',
92 help="Local time zone for this installation. All choices can be found "
93 "here: http://en.wikipedia.org/wiki/List_of_tz_zones_by_name "
94 "(although not all systems may support all possibilities)")
95- django.language_code = StringConfigOption(default='en-us',
96+ django.language_code = StringOption(default='en-us',
97 help="Language code for this installation. All choices can be found "
98 "here: http://www.i18nguy.com/unicode/language-identifiers.html")
99- django.languages = LinesConfigOption(
100- item=TupleConfigOption(length=2),
101+ django.languages = ListOption(
102+ item=TupleOption(length=2),
103 default=[('ar', gettext_noop('Arabic')),
104 ('bn', gettext_noop('Bengali')),
105 ('bg', gettext_noop('Bulgarian')),
106@@ -127,83 +127,83 @@
107 "The language name should be the utf-8 encoded local name "
108 "for the language")
109
110- django.languages_bidi = TupleConfigOption(default=('he', 'ar', 'fa'),
111+ django.languages_bidi = TupleOption(default=('he', 'ar', 'fa'),
112 help="Languages using BiDi (right-to-left) layout")
113
114- django.use_i18n = BoolConfigOption(default=True,
115+ django.use_i18n = BoolOption(default=True,
116 help="If you set this to False, Django will make some optimizations "
117 "so as not to load the internationalization machinery")
118
119- django.locale_paths = LinesConfigOption(item=StringConfigOption())
120- django.language_cookie_name = StringConfigOption(default='django_language')
121+ django.locale_paths = ListOption(item=StringOption())
122+ django.language_cookie_name = StringOption(default='django_language')
123
124- django.managers = LinesConfigOption(item=TupleConfigOption(2), default=[],
125+ django.managers = ListOption(item=TupleOption(2), default=[],
126 help="Not-necessarily-technical managers of the site. They get broken "
127 "link notifications and other various e-mails")
128
129- django.default_content_type = StringConfigOption(default='text/html',
130+ django.default_content_type = StringOption(default='text/html',
131 help="Default content type and charset to use for all HttpResponse "
132 "objects, if a MIME type isn't manually specified. These are "
133 "used to construct the Content-Type header")
134- django.default_charset = StringConfigOption(default='utf-8')
135+ django.default_charset = StringOption(default='utf-8')
136
137- django.file_charset = StringConfigOption(default='utf-8',
138+ django.file_charset = StringOption(default='utf-8',
139 help="Encoding of files read from disk (template and initial "
140 "SQL files)")
141
142- django.server_email = StringConfigOption(
143+ django.server_email = StringOption(
144 help="E-mail address that error messages come from",
145 default='root@localhost')
146
147- django.send_broken_link_emails = BoolConfigOption(default=False,
148+ django.send_broken_link_emails = BoolOption(default=False,
149 help="Whether to send broken-link e-mails")
150
151- django.database_engine = StringConfigOption(default='',
152+ django.database_engine = StringOption(default='',
153 help="'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3'"
154 " or 'oracle'")
155- django.database_name = StringConfigOption(default='',
156+ django.database_name = StringOption(default='',
157 help="Or path to database file if using sqlite3")
158- django.database_user = StringConfigOption(default='',
159- help="Not used with sqlite3")
160- django.database_password= StringConfigOption(default='',
161- help="Not used with sqlite3")
162- django.database_host = StringConfigOption(default='',
163+ django.database_user = StringOption(default='',
164+ help="Not used with sqlite3")
165+ django.database_password= StringOption(default='',
166+ help="Not used with sqlite3")
167+ django.database_host = StringOption(default='',
168 help="Set to empty string for localhost. Not used with sqlite3")
169- django.database_port = StringConfigOption(default='',
170+ django.database_port = StringOption(default='',
171 help="Set to empty string for default. Not used with sqlite3")
172- django.database_options = DictConfigOption(
173+ django.database_options = DictOption(
174 help="Set to empty dictionary for default")
175
176- django.email_host = StringConfigOption(default='localhost',
177+ django.email_host = StringOption(default='localhost',
178 help="Host for sending e-mail")
179- django.email_port = IntConfigOption(default=25,
180+ django.email_port = IntOption(default=25,
181 help="Port for sending e-mail")
182
183- django.email_host_user = StringConfigOption(default='',
184- help="Optional SMTP authentication information for EMAIL_HOST")
185- django.email_host_password = StringConfigOption(default='',
186- help="Optional SMTP authentication information for EMAIL_HOST")
187- django.email_use_tls = BoolConfigOption(default=False,
188+ django.email_host_user = StringOption(default='',
189+ help="Optional SMTP authentication information for EMAIL_HOST")
190+ django.email_host_password = StringOption(default='',
191+ help="Optional SMTP authentication information for EMAIL_HOST")
192+ django.email_use_tls = BoolOption(default=False,
193 help="Optional SMTP authentication information for EMAIL_HOST")
194
195- django.installed_apps = LinesConfigOption(item=StringConfigOption(),
196+ django.installed_apps = ListOption(item=StringOption(),
197 default=['django.contrib.auth',
198 'django.contrib.contenttypes',
199 'django.contrib.sessions',
200 'django.contrib.sites'],
201 help="List of strings representing installed apps")
202
203- django.template_dirs = LinesConfigOption(item=StringConfigOption(),
204+ django.template_dirs = ListOption(item=StringOption(),
205 help="List of locations of the template source files, in search order")
206
207- django.template_loaders = LinesConfigOption(item=StringConfigOption(),
208+ django.template_loaders = ListOption(item=StringOption(),
209 default=['django.template.loaders.filesystem.load_template_source',
210 'django.template.loaders.app_directories.load_template_source'],
211 help="List of callables that know how to import templates from "
212 "various sources")
213
214- django.template_context_processors = LinesConfigOption(
215- item=StringConfigOption(),
216+ django.template_context_processors = ListOption(
217+ item=StringOption(),
218 default=['django.core.context_processors.auth',
219 'django.core.context_processors.debug',
220 'django.core.context_processors.i18n',
221@@ -213,132 +213,132 @@
222 "object as its only parameter and returns a dictionary to add to "
223 "the context")
224
225- django.template_string_if_invalid = StringConfigOption(default='',
226+ django.template_string_if_invalid = StringOption(default='',
227 help="Output to use in template system for invalid "
228 "(e.g. misspelled) variables")
229
230- django.admin_media_prefix = StringConfigOption(default='/media/',
231+ django.admin_media_prefix = StringOption(default='/media/',
232 help="URL prefix for admin media -- CSS, JavaScript and images. "
233 "Make sure to use a trailing slash. "
234 "Examples: 'http://foo.com/media/', '/media/'")
235
236- django.default_from_email = StringConfigOption(
237+ django.default_from_email = StringOption(
238 default='webmaster@localhost',
239 help="Default e-mail address to use for various automated "
240 "correspondence from the site managers")
241- django.email_subject_prefix = StringConfigOption(default='[Django] ',
242+ django.email_subject_prefix = StringOption(default='[Django] ',
243 help="Subject-line prefix for email messages send with "
244 "django.core.mail.mail_admins or ...mail_managers. Make sure to "
245 "include the trailing space")
246
247- django.append_slash = BoolConfigOption(default=True,
248+ django.append_slash = BoolOption(default=True,
249 help="Whether to append trailing slashes to URLs")
250- django.prepend_www = BoolConfigOption(default=False,
251+ django.prepend_www = BoolOption(default=False,
252 help="Whether to prepend the 'www.' subdomain to URLs that "
253 "don't have it")
254- django.force_script_name = StringConfigOption(null=True,
255+ django.force_script_name = StringOption(null=True,
256 help="Override the server-derived value of SCRIPT_NAME")
257
258- django.disallowed_user_agents = LinesConfigOption(
259- item=StringConfigOption(),
260+ django.disallowed_user_agents = ListOption(
261+ item=StringOption(),
262 default=[],
263 help="List of compiled regular expression objects representing "
264 "User-Agent strings that are not allowed to visit any page, "
265 "systemwide. Use this for bad robots/crawlers")
266
267- django.absolute_url_overrides = DictConfigOption()
268+ django.absolute_url_overrides = DictOption()
269
270- django.allowed_include_roots = TupleConfigOption(
271+ django.allowed_include_roots = TupleOption(
272 help="Tuple of strings representing allowed prefixes for the "
273 "{% ssi %} tag")
274
275- django.admin_for = LinesConfigOption(item=StringConfigOption(),
276+ django.admin_for = ListOption(item=StringOption(),
277 help="If this is a admin settings module, this should be a list of "
278 "settings modules (in the format 'foo.bar.baz') for which this "
279 "admin is an admin")
280
281- django.ignorable_404_starts = LinesConfigOption(item=StringConfigOption(),
282+ django.ignorable_404_starts = ListOption(item=StringOption(),
283 default=['/cgi-bin/', '/_vti_bin', '/_vti_inf'],
284 help="404s that may be ignored")
285- django.ignorable_404_ends = LinesConfigOption(item=StringConfigOption(),
286+ django.ignorable_404_ends = ListOption(item=StringOption(),
287 default=['mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi',
288 'favicon.ico', '.php'])
289
290- django.secret_key = StringConfigOption(raw=True, default='',
291+ django.secret_key = StringOption(raw=True, default='',
292 help="A secret key for this particular Django installation. Used in "
293 "secret-key hashing algorithms. Set this in your settings, or "
294 "Django will complain loudly")
295
296- django.jing_path = StringConfigOption(default='/usr/bin/jing',
297+ django.jing_path = StringOption(default='/usr/bin/jing',
298 help="Path to the 'jing' executable -- needed to validate XMLFields")
299
300- django.default_file_storage = StringConfigOption(
301+ django.default_file_storage = StringOption(
302 default='django.core.files.storage.FileSystemStorage',
303 help="Default file storage mechanism that holds media")
304
305- django.media_root = StringConfigOption(default='',
306+ django.media_root = StringOption(default='',
307 help="Absolute path to the directory that holds media")
308
309- django.media_url = StringConfigOption(default='',
310+ django.media_url = StringOption(default='',
311 help="URL that handles the media served from MEDIA_ROOT")
312
313- django.file_upload_handlers = LinesConfigOption(item=StringConfigOption(),
314+ django.file_upload_handlers = ListOption(item=StringOption(),
315 default=['django.core.files.uploadhandler.MemoryFileUploadHandler',
316 'django.core.files.uploadhandler.TemporaryFileUploadHandler'],
317 help="List of upload handler classes to be applied in order")
318
319- django.file_upload_max_memory_size = IntConfigOption(default=2621440,
320+ django.file_upload_max_memory_size = IntOption(default=2621440,
321 help="Maximum size, in bytes, of a request before it will be streamed "
322 "to the file system instead of into memory")
323
324- django.file_upload_temp_dir = StringConfigOption(null=True,
325+ django.file_upload_temp_dir = StringOption(null=True,
326 help="Directory in which upload streamed files will be temporarily "
327 "saved. A value of `None` will make Django use the operating "
328 "system's default temporary directory (i.e. '/tmp' on *nix "
329 "systems)")
330
331- django.file_upload_permissions = StringConfigOption(null=True,
332+ django.file_upload_permissions = StringOption(null=True,
333 help="The numeric mode to set newly-uploaded files to. The value "
334 "should be a mode you'd pass directly to os.chmod; "
335 "see http://docs.python.org/lib/os-file-dir.html")
336
337- django.date_format = StringConfigOption(default='N j, Y',
338+ django.date_format = StringOption(default='N j, Y',
339 help="Default formatting for date objects. See all available format "
340 "strings here: "
341 "http://docs.djangoproject.com/en/dev/ref/templates/builtins/#now")
342
343- django.datetime_format = StringConfigOption(default='N j, Y, P',
344+ django.datetime_format = StringOption(default='N j, Y, P',
345 help="Default formatting for datetime objects. See all available "
346 "format strings here: "
347 "http://docs.djangoproject.com/en/dev/ref/templates/builtins/#now")
348
349- django.time_format = StringConfigOption(default='P',
350+ django.time_format = StringOption(default='P',
351 help="Default formatting for time objects. See all available format "
352 "strings here: "
353 "http://docs.djangoproject.com/en/dev/ref/templates/builtins/#now")
354
355- django.year_month_format = StringConfigOption(default='F Y',
356+ django.year_month_format = StringOption(default='F Y',
357 help="Default formatting for date objects when only the year and "
358 "month are relevant. See all available format strings here: "
359 "http://docs.djangoproject.com/en/dev/ref/templates/builtins/#now")
360
361- django.month_day_format = StringConfigOption(default='F j',
362+ django.month_day_format = StringOption(default='F j',
363 help="Default formatting for date objects when only the month and "
364 "day are relevant. See all available format strings here: "
365 "http://docs.djangoproject.com/en/dev/ref/templates/builtins/#now")
366
367- django.transactions_managed = BoolConfigOption(default=False,
368+ django.transactions_managed = BoolOption(default=False,
369 help="Do you want to manage transactions manually? "
370 "Hint: you really don't!")
371
372- django.url_validator_user_agent = StringConfigOption(
373+ django.url_validator_user_agent = StringOption(
374 default="Django/%s (http://www.djangoproject.com)" % get_version(),
375 help="The User-Agent string to use when checking for URL validity "
376 "through the isExistingURL validator")
377- django.default_tablespace = StringConfigOption(default='',
378+ django.default_tablespace = StringOption(default='',
379 help="The tablespaces to use for each model when not "
380 "specified otherwise")
381- django.default_index_tablespace = StringConfigOption(default='',
382+ django.default_index_tablespace = StringOption(default='',
383 help="The tablespaces to use for each model when not "
384 "specified otherwise")
385
386@@ -346,7 +346,7 @@
387 # MIDDLEWARE #
388 ##############
389
390- django.middleware_classes = LinesConfigOption(item=StringConfigOption(),
391+ django.middleware_classes = ListOption(item=StringOption(),
392 default=['django.middleware.common.CommonMiddleware',
393 'django.contrib.sessions.middleware.SessionMiddleware',
394 'django.contrib.auth.middleware.AuthenticationMiddleware'],
395@@ -359,26 +359,26 @@
396 # SESSIONS #
397 ############
398
399- django.session_cookie_name = StringConfigOption(default='sessionid',
400+ django.session_cookie_name = StringOption(default='sessionid',
401 help="Cookie name")
402- django.session_cookie_age = IntConfigOption(default=60*60*24*7*2,
403+ django.session_cookie_age = IntOption(default=60*60*24*7*2,
404 help="Age of cookie, in seconds (default: 2 weeks)")
405- django.session_cookie_domain = StringConfigOption(null=True,
406+ django.session_cookie_domain = StringOption(null=True,
407 help="A string like '.lawrence.com', or None for standard "
408 "domain cookie")
409- django.session_cookie_secure = BoolConfigOption(default=False,
410+ django.session_cookie_secure = BoolOption(default=False,
411 help="Wether the session cookie should be secure (https:// only)")
412- django.session_cookie_path = StringConfigOption(default='/',
413+ django.session_cookie_path = StringOption(default='/',
414 help="The path of the sesion cookie")
415- django.session_save_every_request = BoolConfigOption(default=False,
416+ django.session_save_every_request = BoolOption(default=False,
417 help="Whether to save the session data on every request")
418- django.session_expire_at_browser_close = BoolConfigOption(default=False,
419+ django.session_expire_at_browser_close = BoolOption(default=False,
420 help="Whether a user's session cookie expires when the Web browser "
421 "is closed")
422- django.session_engine = StringConfigOption(
423+ django.session_engine = StringOption(
424 default='django.contrib.sessions.backends.db',
425 help="The module to store session data")
426- django.session_file_path = StringConfigOption(null=True,
427+ django.session_file_path = StringOption(null=True,
428 help="Directory to store session files if using the file session "
429 "module. If None, the backend will use a sensible default")
430
431@@ -386,36 +386,36 @@
432 # CACHE #
433 #########
434
435- django.cache_backend = StringConfigOption(default='locmem://',
436+ django.cache_backend = StringOption(default='locmem://',
437 help="The cache backend to use. See the docstring in "
438 "django.core.cache for the possible values")
439- django.cache_middleware_key_prefix = StringConfigOption(default='')
440- django.cache_middleware_seconds = IntConfigOption(default=600)
441+ django.cache_middleware_key_prefix = StringOption(default='')
442+ django.cache_middleware_seconds = IntOption(default=600)
443
444 ####################
445 # COMMENTS #
446 ####################
447
448- django.comments_allow_profanities = BoolConfigOption(default=False)
449- django.profanities_list = LinesConfigOption(item=StringConfigOption(),
450+ django.comments_allow_profanities = BoolOption(default=False)
451+ django.profanities_list = ListOption(item=StringOption(),
452 default=['asshat', 'asshead', 'asshole', 'cunt', 'fuck', 'gook',
453 'nigger', 'shit'],
454 help="The profanities that will trigger a validation error in the "
455 "'hasNoProfanities' validator. All of these should be in "
456 "lowercase")
457- django.comments_banned_users_group = StringConfigOption(null=True,
458+ django.comments_banned_users_group = StringOption(null=True,
459 help="The group ID that designates which users are banned. "
460 "Set to None if you're not using it")
461- django.comments_moderators_group = StringConfigOption(null=True,
462+ django.comments_moderators_group = StringOption(null=True,
463 help="The group ID that designates which users can moderate comments. "
464 "Set to None if you're not using it")
465- django.comments_sketchy_users_group = StringConfigOption(null=True,
466+ django.comments_sketchy_users_group = StringOption(null=True,
467 help="The group ID that designates the users whose comments should be "
468 "e-mailed to MANAGERS. Set to None if you're not using it")
469- django.comments_first_few = IntConfigOption(default=0,
470+ django.comments_first_few = IntOption(default=0,
471 help="The system will e-mail MANAGERS the first COMMENTS_FIRST_FEW "
472 "comments by each user. Set this to 0 if you want to disable it")
473- django.banned_ips = TupleConfigOption(
474+ django.banned_ips = TupleOption(
475 help="A tuple of IP addresses that have been banned from "
476 "participating in various Django-powered features")
477
478@@ -423,31 +423,31 @@
479 # AUTHENTICATION #
480 ##################
481
482- django.authentication_backends = LinesConfigOption(
483- item=StringConfigOption(),
484+ django.authentication_backends = ListOption(
485+ item=StringOption(),
486 default=['django.contrib.auth.backends.ModelBackend'])
487- django.login_url = StringConfigOption(default='/accounts/login/')
488- django.logout_url = StringConfigOption(default='/accounts/logout/')
489- django.login_redirect_url = StringConfigOption(default='/accounts/profile/')
490- django.password_reset_timeout_days = IntConfigOption(default=3,
491+ django.login_url = StringOption(default='/accounts/login/')
492+ django.logout_url = StringOption(default='/accounts/logout/')
493+ django.login_redirect_url = StringOption(default='/accounts/profile/')
494+ django.password_reset_timeout_days = IntOption(default=3,
495 help="The number of days a password reset link is valid for")
496
497 ###########
498 # TESTING #
499 ###########
500
501- django.test_runner = StringConfigOption(
502+ django.test_runner = StringOption(
503 default='django.test.simple.run_tests',
504 help="The name of the method to use to invoke the test suite")
505- django.test_database_name = StringConfigOption(null=True,
506+ django.test_database_name = StringOption(null=True,
507 help="The name of the database to use for testing purposes. "
508 "If None, a name of 'test_' + DATABASE_NAME will be assumed")
509- django.test_database_charset = StringConfigOption(null=True,
510+ django.test_database_charset = StringOption(null=True,
511 help="Strings used to set the character set and collation order for "
512 "the test database. These values are passed literally to the "
513 "server, so they are backend-dependent. If None, no special "
514 "settings are sent (system defaults are used)")
515- django.test_database_collation = StringConfigOption(null=True,
516+ django.test_database_collation = StringOption(null=True,
517 help="Strings used to set the character set and collation order for "
518 "the test database. These values are passed literally to the "
519 "server, so they are backend-dependent. If None, no special "
520@@ -457,15 +457,15 @@
521 # FIXTURES #
522 ############
523
524- django.fixture_dirs = LinesConfigOption(item=StringConfigOption(),
525+ django.fixture_dirs = ListOption(item=StringOption(),
526 help="The list of directories to search for fixtures")
527
528 ####################
529 # PROJECT TEMPLATE #
530 ####################
531
532- django.site_id = IntConfigOption(default=1)
533- django.root_urlconf = StringConfigOption(default='urls')
534+ django.site_id = IntOption(default=1)
535+ django.root_urlconf = StringOption(default='urls')
536
537
538 class Django112Schema(BaseDjangoSchema):
539@@ -479,7 +479,7 @@
540 ################
541
542 # update default value
543- django.languages.default = (
544+ django.languages.default = [
545 ('ar', gettext_noop('Arabic')),
546 ('bg', gettext_noop('Bulgarian')),
547 ('bn', gettext_noop('Bengali')),
548@@ -535,7 +535,7 @@
549 ('uk', gettext_noop('Ukrainian')),
550 ('zh-cn', gettext_noop('Simplified Chinese')),
551 ('zh-tw', gettext_noop('Traditional Chinese')),
552- )
553+ ]
554
555
556 class Django125Schema(Django112Schema):
557@@ -614,19 +614,19 @@
558 ('zh-tw', gettext_noop('Traditional Chinese')),
559 ]
560
561- django.use_l10n = BoolConfigOption(
562+ django.use_l10n = BoolOption(
563 default=True,
564 help="If you set this to False, Django will not format dates, "
565 "numbers and calendars according to the current locale")
566
567- django.databases = DictConfigOption(
568- item=UpperCaseDictConfigOption(spec={
569- 'engine': StringConfigOption(default='django.db.backends.'),
570- 'name': StringConfigOption(),
571- 'user': StringConfigOption(),
572- 'password': StringConfigOption(),
573- 'host': StringConfigOption(),
574- 'port': StringConfigOption(),
575+ django.databases = DictOption(
576+ item=UpperCaseDictOption(spec={
577+ 'engine': StringOption(default='django.db.backends.'),
578+ 'name': StringOption(),
579+ 'user': StringOption(),
580+ 'password': StringOption(),
581+ 'host': StringOption(),
582+ 'port': StringOption(),
583 }),
584 default={
585 'default': {
586@@ -638,11 +638,11 @@
587 'port': '',
588 }
589 })
590- django.database_routers = LinesConfigOption(
591- item=StringConfigOption(),
592+ django.database_routers = ListOption(
593+ item=StringOption(),
594 help="Classes used to implement db routing behaviour")
595
596- django.email_backend = StringConfigOption(
597+ django.email_backend = StringOption(
598 default='django.core.mail.backends.smtp.EmailBackend',
599 help="The email backend to use. For possible shortcuts see "
600 "django.core.mail. The default is to use the SMTP backend. "
601@@ -670,20 +670,20 @@
602 'django.contrib.messages.context_processors.messages',
603 ]
604
605- django.format_module_path = StringConfigOption(
606+ django.format_module_path = StringOption(
607 null=True, default=None,
608 help="Python module path where user will place custom format "
609 "definition. The directory where this setting is pointing "
610 "should contain subdirectories named as the locales, "
611 "containing a formats.py file")
612- django.short_date_format = StringConfigOption(
613+ django.short_date_format = StringOption(
614 default='m/d/Y',
615 help="Default short formatting for date objects")
616- django.short_datetime_format = StringConfigOption(
617+ django.short_datetime_format = StringOption(
618 default='m/d/Y P',
619 help="Default short formatting for datetime objects")
620- django.date_input_formats = LinesConfigOption(
621- item=StringConfigOption(),
622+ django.date_input_formats = ListOption(
623+ item=StringOption(),
624 default=[
625 '%%Y-%%m-%%d', '%%m/%%d/%%Y', '%%m/%%d/%%y', # '2006-10-25', '10/25/2006', '10/25/06'
626 '%%b %%d %%Y', '%%b %%d, %%Y', # 'Oct 25 2006', 'Oct 25, 2006'
627@@ -693,16 +693,16 @@
628 ],
629 help="Default formats to be used when parsing dates from input "
630 "boxes, in order")
631- django.time_input_formats = LinesConfigOption(
632- item=StringConfigOption(),
633+ django.time_input_formats = ListOption(
634+ item=StringOption(),
635 default=[
636 '%%H:%%M:%%S', # '14:30:59'
637 '%%H:%%M', # '14:30'
638 ],
639 help="Default formats to be used when parsing times from input "
640 "boxes, in order")
641- django.datetime_input_formats = LinesConfigOption(
642- item=StringConfigOption(),
643+ django.datetime_input_formats = ListOption(
644+ item=StringOption(),
645 default=[
646 '%%Y-%%m-%%d %%H:%%M:%%S', # '2006-10-25 14:30:59'
647 '%%Y-%%m-%%d %%H:%%M', # '2006-10-25 14:30'
648@@ -717,23 +717,23 @@
649 help="Default formats to be used when parsing dates and times "
650 "from input boxes, in order")
651
652- django.first_day_of_week = IntConfigOption(
653+ django.first_day_of_week = IntOption(
654 default=0,
655 help="First day of week, to be used on calendars. 0 means Sunday, "
656 "1 means Monday...")
657- django.decimal_separator = StringConfigOption(
658+ django.decimal_separator = StringOption(
659 default='.',
660 help="Decimal separator symbol")
661- django.use_thousand_separator = BoolConfigOption(
662+ django.use_thousand_separator = BoolOption(
663 default=False,
664 help="Boolean that sets whether to add thousand separator when "
665 "formatting numbers")
666- django.number_grouping = IntConfigOption(
667+ django.number_grouping = IntOption(
668 default=0,
669 help="Number of digits that will be together, when splitting them "
670 "by THOUSAND_SEPARATOR. 0 means no grouping, 3 means "
671 "splitting by thousands...")
672- django.thousand_separator = StringConfigOption(
673+ django.thousand_separator = StringOption(
674 default=',',
675 help="Thousand separator symbol")
676
677@@ -753,14 +753,14 @@
678 # CSRF #
679 ########
680
681- django.csrf_failure_view = StringConfigOption(
682+ django.csrf_failure_view = StringOption(
683 default='django.views.csrf.csrf_failure',
684 help="Dotted path to callable to be used as view when a request "
685 "is rejected by the CSRF middleware")
686- django.csrf_cookie_name = StringConfigOption(
687+ django.csrf_cookie_name = StringOption(
688 default='csrftoken',
689 help="Name for CSRF cookie")
690- django.csrf_cookie_domain = StringConfigOption(
691+ django.csrf_cookie_domain = StringOption(
692 null=True,
693 help="Domain for CSRF cookie")
694
695@@ -768,7 +768,7 @@
696 # MESSAGES #
697 ############
698
699- django.message_storage = StringConfigOption(
700+ django.message_storage = StringOption(
701 default='django.contrib.messages.storage.user_messages.'
702 'LegacyFallbackStorage',
703 help="Class to be used as messages backend")
704@@ -873,11 +873,11 @@
705 'django.contrib.messages.context_processors.messages',
706 ]
707
708- django.static_root = StringConfigOption(
709+ django.static_root = StringOption(
710 default='',
711 help='Absolute path to the directory that holds static files.')
712
713- django.static_url = StringConfigOption(
714+ django.static_url = StringOption(
715 null=True, default=None,
716 help='URL that handles the static files served from STATIC_ROOT.')
717
718@@ -885,7 +885,7 @@
719 # SESSIONS #
720 ############
721
722- django.session_cookie_httponly = BoolConfigOption(
723+ django.session_cookie_httponly = BoolOption(
724 default=False,
725 help='Whether to use the non-RFC standard htt pOnly flag (IE, FF3+, others)')
726
727@@ -896,44 +896,44 @@
728 # remove obsoleted setting
729 del django.cache_backend
730
731- django.caches = DictConfigOption()
732- django.cache_middleware_alias = StringConfigOption(default='default')
733+ django.caches = DictOption()
734+ django.cache_middleware_alias = StringOption(default='default')
735
736 ############
737 # COMMENTS #
738 ############
739
740- django.profanities_list.default = ()
741+ django.profanities_list.default = []
742
743 ###########
744 # LOGGING #
745 ###########
746
747- django.logging_config = StringConfigOption(
748+ django.logging_config = StringOption(
749 default='django.utils.log.dictConfig',
750 help='The callable to use to configure logging')
751- django.logging = DictConfigOption(
752+ django.logging = DictOption(
753 spec={
754- 'version': IntConfigOption(default=1),
755- 'disable_existing_loggers': BoolConfigOption(default=False),
756- 'handlers': DictConfigOption(
757+ 'version': IntOption(default=1),
758+ 'disable_existing_loggers': BoolOption(default=False),
759+ 'handlers': DictOption(
760 spec={
761- 'mail_admins': DictConfigOption(
762+ 'mail_admins': DictOption(
763 spec={
764- 'level': StringConfigOption(default='ERROR'),
765- 'class': StringConfigOption(
766+ 'level': StringOption(default='ERROR'),
767+ 'class': StringOption(
768 default='django.utils.log.AdminEmailHandler'),
769 }),
770 }),
771- 'loggers': DictConfigOption(
772+ 'loggers': DictOption(
773 spec={
774- 'django.request': DictConfigOption(
775+ 'django.request': DictOption(
776 spec={
777- 'handlers': LinesConfigOption(
778- item=StringConfigOption(),
779+ 'handlers': ListOption(
780+ item=StringOption(),
781 default=['mail_admins']),
782- 'level': StringConfigOption(default='ERROR'),
783- 'propagate': BoolConfigOption(default=True),
784+ 'level': StringOption(default='ERROR'),
785+ 'propagate': BoolOption(default=True),
786 }),
787 }),
788 },
789@@ -945,14 +945,14 @@
790 # STATICFILES #
791 ###############
792
793- django.staticfiles_dirs = LinesConfigOption(
794- item=StringConfigOption(),
795+ django.staticfiles_dirs = ListOption(
796+ item=StringOption(),
797 help='A list of locations of additional static files')
798- django.staticfiles_storage = StringConfigOption(
799+ django.staticfiles_storage = StringOption(
800 default='django.contrib.staticfiles.storage.StaticFilesStorage',
801 help='The default file storage backend used during the build process')
802- django.staticfiles_finders = LinesConfigOption(
803- item=StringConfigOption(),
804+ django.staticfiles_finders = ListOption(
805+ item=StringOption(),
806 default=[
807 'django.contrib.staticfiles.finders.FileSystemFinder',
808 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
809
810=== modified file 'django_configglue/tests/test_configglue.py'
811--- django_configglue/tests/test_configglue.py 2011-04-13 12:59:26 +0000
812+++ django_configglue/tests/test_configglue.py 2011-06-23 19:15:58 +0000
813@@ -8,10 +8,10 @@
814
815 import django
816 from configglue.pyschema.schema import (
817- DictConfigOption,
818- IntConfigOption,
819+ DictOption,
820+ IntOption,
821 Schema,
822- StringConfigOption,
823+ StringOption,
824 )
825 from configglue.pyschema.parser import (
826 CONFIG_FILE_ENCODING,
827@@ -30,7 +30,7 @@
828 from django_configglue.schema import (
829 BaseDjangoSchema,
830 DjangoSchemaFactory,
831- UpperCaseDictConfigOption,
832+ UpperCaseDictOption,
833 schemas,
834 )
835 from django_configglue.tests.helpers import ConfigGlueDjangoCommandTestCase
836@@ -39,10 +39,10 @@
837 class DjangoSupportTestCase(TestCase):
838 def test_get_django_settings(self):
839 class MySchema(Schema):
840- foo = IntConfigOption()
841- bar = DictConfigOption(
842- spec={'baz': IntConfigOption(),
843- 'BAZ': IntConfigOption()})
844+ foo = IntOption()
845+ bar = DictOption(
846+ spec={'baz': IntOption(),
847+ 'BAZ': IntOption()})
848
849 expected = {'FOO': 0, 'BAR': {'baz': 0, 'BAZ': 0}}
850
851@@ -52,7 +52,7 @@
852
853 def test_get_django_settings_encoding(self):
854 class MySchema(Schema):
855- foo = StringConfigOption()
856+ foo = StringOption()
857
858 expected = {'FOO': u'€'.encode(SETTINGS_ENCODING)}
859
860@@ -65,7 +65,7 @@
861
862 def test_update_settings(self):
863 class MySchema(Schema):
864- foo = IntConfigOption()
865+ foo = IntOption()
866
867 env = {}
868 parser = SchemaConfigParser(MySchema())
869@@ -249,10 +249,10 @@
870 self.assertTrue('Show settings attributes' in self.capture['stdout'])
871
872
873-class UpperCaseDictConfigOptionTestCase(TestCase):
874+class UpperCaseDictOptionTestCase(TestCase):
875 def test_parse(self):
876 class MySchema(Schema):
877- foo = UpperCaseDictConfigOption()
878+ foo = UpperCaseDictOption()
879 config = StringIO(textwrap.dedent("""
880 [__main__]
881 foo = mydict
882
883=== modified file 'setup.py'
884--- setup.py 2011-04-15 20:19:20 +0000
885+++ setup.py 2011-06-23 19:15:58 +0000
886@@ -35,7 +35,7 @@
887
888 # content
889 packages=find_packages(exclude=['testproject*']),
890- install_requires=['django >= 1.0.2-final', 'configglue >= 0.9.1'],
891+ install_requires=['django >= 1.0.2-final', 'configglue > 0.10'],
892
893 # tests
894 test_suite='testproject.testrunner.runtests',

Subscribers

People subscribed via source and target branches

to all changes: