Commit graph

36 commits

Author SHA1 Message Date
Tomasz Kłoczko
6dc2340dfe really drop support for python<=3.7
Filer all code over `pyupgrade --py38`.

Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
2024-03-18 16:08:42 +00:00
Tim Gates
ac5408d7eb
docs: Fix a few typos
There are small typos in:
- configurations/base.py
- configurations/values.py
- docs/patterns.rst

Fixes:
- Should read `whether` rather than `wether`.
- Should read `overridden` rather than `overriden`.
- Should read `environment` rather than `enviroment`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
2022-09-01 20:41:53 +10:00
Brian Helba
91ef9fd8ad Fix a double space typo in a string 2021-10-25 09:50:51 -04:00
Michael Käufl
9b9ff4c0a2 Deprecate utils.import_by_path in favor of django.utils.module_loading.import_string 2021-01-19 13:11:16 +06:00
Michael Käufl
6cb932e47f Run pyupgrade on the code
But don't touch string formatting.

https://pypi.org/project/pyupgrade/
2021-01-19 13:11:16 +06:00
John Franey
41b905c92e Update tested Python & Django versions
Replaces `django.utils.six` with `six` to support newer Django versions.

Updates Tox config to:
- remove unsupported Django versions
- add pypy3
- add Django 2.2
- update djmaster Python versions
2019-10-06 15:43:03 -04:00
Daniel Hahler
605e6fe296
flake8: ignore W503 (and pick W504) (#220) 2018-12-09 18:48:17 +01:00
Peter Bittner
06f2d57386 Fix flake8 complaints 2018-12-09 15:52:53 +01:00
Mike
1c6fd0f505 Add PositiveIntegerValue to only allow positive integers (#186) 2018-03-15 13:19:50 +01:00
José Antonio Perdiguero
a606003c77 Fix truthy and falsey of values (#162) 2016-10-13 00:00:47 +02:00
Jannis Leidel
010067b433 Introduced environ_required parameter for Value class. Refs #118. 2015-08-09 14:54:55 +02:00
Jannis Leidel
8ba1804ff2 Added full_environ_name method to Value class. 2015-08-09 14:48:16 +02:00
Jannis Leidel
5ece107044 Only run __init__ in __new__ when late binding is enabled.
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2015-03-16 21:19:40 +01:00
Miguel Araujo Perez
e09e1e0f42 Added equal operator to values.Value
Allows value setting to work when checking if setting variable is within
a list, i.e: settings.database in ['default', 'other']

Signed-off-by: Jannis Leidel <jannis@leidel.info>
2015-03-16 20:54:17 +01:00
Jannis Leidel
c60b7daac4 Fixed SequenceValue to work on Python 3.x. 2015-02-13 22:29:14 +01:00
Christian Abbott
8287ab6f7f Merge remote-tracking branch 'upstream/master' 2015-01-07 03:19:24 -08:00
Christian Abbott
e0a68fdbb6 Rename TupleOfTupleValue to SingleNestedTupleValue; Add SingleNestedListValue and do a DRY refactor of ListValue, TupleValue, and their SingleNested subclasses 2015-01-07 03:08:30 -08:00
Jannis Leidel
44476bdd1d Merge remote-tracking branch 'hiisi13/master'
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2015-01-06 23:15:08 +01:00
Mauricio de Abreu Antunes
3f892f9814 Fixed wrong behaviour when assigning BooleanValue
When assigning False to a BooleanValue and reusing it was raising a
ValueError exception because BooleanValue was evaluating False as None.

Thanks to @abbottc for catching this error.
2014-12-27 10:34:40 -02:00
Christian Abbott
c4ba5ca559 Add TupleOfTuplesValue along with associated tests and updated documentation 2014-12-18 07:15:20 -08:00
Jannis Leidel
fb9275744e Merge pull request #78 from slafs/validationmixinfix
fix ValidationMixin instantiation with no default
2014-12-12 16:28:58 +01:00
Sławek Ehlert
8d366fca44 fix ValidationMixin instantiation with no default
with tests. fixes #69
2014-10-30 23:44:48 +01:00
He Weiwei
f8ebb564da fix bug of setup_value func for EmailURLValue 2014-10-08 12:19:35 +08:00
Sven Aßmann
4018f7b42a - add late_binding to value with default False
- this enables a value to load from environment if the env variable name is given at construction time
- cache value of environment value now in property value
- add __new__ to allow a construction of a given type from environment directly. In this case now Value instance is constructed but an instance of the desired type that is covered by the Value implementation. For Value it is str, for DictValue it is dict etc.
- extend tests for this new behavior
- extend test coverage for some other places
2014-05-02 22:51:48 +02:00
Dmitry Kozhedubov
e33eeeb871 Ability to pass keyword args to CastingMixin casters 2014-03-02 13:31:42 +04:00
Jannis Leidel
f087cea84d Added SearchURLValue. 2014-01-16 19:00:29 +01:00
Stefan Wehrmeyer
5e8dc290df Fix CacheURLValue default value
Remove unused kwarg 'name' that shadows kwarg
'default'.
2013-10-06 16:33:24 +02:00
Jannis Leidel
e453d2355d Fix a Python2ism 2013-09-06 23:28:50 +02:00
Jannis Leidel
3848e6b818 Drastically simplified exception messages in the importer.
Less eyebleed® included!
2013-09-06 22:41:14 +02:00
Jannis Leidel
dacca7e073 Use ValueError instead of Django's ImproperlyConfigured.
This is to prevent hiding the real reason of a configuration failure behind one of Django's import time exceptions.
2013-09-06 22:40:15 +02:00
Jannis Leidel
927c052be5 Changed the default of the Value's environ option to True. 2013-09-03 12:03:34 +02:00
Jannis Leidel
61bb7b0e44 Fixed string formatting. Part 2. 2013-07-27 16:07:43 +02:00
Jannis Leidel
90292e3cec Fixed string formatting. 2013-07-27 16:05:23 +02:00
Jannis Leidel
b8222d2271 Raise an ImproperlyConfigured exception if value handling doesn't work, thanks @pydanny for the suggestion. 2013-07-27 15:38:30 +02:00
Jannis Leidel
ef26377f13 Force list return value for filtered result. 2013-07-27 13:20:42 +02:00
Jannis Leidel
1a54847375 Added a configuration values system.
This also adds some advanced features like a setup classmethod to the Configuration class.
Reorganized and extended the documentation.
2013-07-27 12:37:28 +02:00