- Feb 27, 2025
-
- Feb 20, 2025
-
-
Štěpán Henek authored
-
Štěpán Henek authored
-
Štěpán Henek authored
-
- Feb 19, 2025
-
-
Štěpán Henek authored
-
- Feb 13, 2025
-
- Aug 03, 2023
-
-
Štěpán Henek authored
Added - `Uci.add` function for adding anonymous section implemented - `EUci.add` function to add both anonymous and named sections added
-
-
- Jul 27, 2023
-
-
Štěpán Henek authored
-
- Jul 21, 2023
-
-
Štěpán Henek authored
-
- Mar 09, 2023
-
-
Štěpán Henek authored
-
-
- Mar 04, 2022
-
-
Karel Koci authored
Added * `convert` argument for `EUci.get`. It provides a way to convert values to any type with custom function. Changed * `list` argument for `EUci.get` is now required to be set to `True` for lists otherwise only first value is returned. This is removal of auto-detection of lists. The get of list has to be now always explictly stated. * `dtype` argument for `EUci.get` can now be any type that can be initialized with string as a single argument (such as `int("42")`. * `default` argument for `EUci.get` now uses object instance `NoDefault` to detect that there is no default instead of presence of keyword argument. Removed * obsolete "get" methods in `EUci`
-
Karel Koci authored
-
Karel Koci authored
This also completely removes Python2.
-
Karel Koci authored
This is in some corner cases incompatible change. The incompatible changes here are: * The raised exception in case of conversion error is no longer ValueError but rather UciExceptionNotFound. * The list argument now always has to be specified to `list=True` for list of configs. There is no longer a mode when either tuple or value is returned. It is one or the other depending on list argument. * No default is now detected using dedicated NoDefault object instance instead of using presence of the argument. In most cases this affects nothing. The new convert argument adds an easy way to convert values to any type by providing lambda function that implements such conversion.
-
- Dec 09, 2021
-
-
Karel Koci authored
This way we can support any type that can be initialized from string and exception depends on type called tries to convert string into.
-
- Dec 04, 2020
-
-
Karel Koci authored
Support was added in 02db2708.
-
Karel Koci authored
-
- Nov 20, 2020
-
-
Karel Koci authored
Fixed * missing include `collections.abc` in `euci` module
-
Karel Koci authored
We have to import collections.abc instead of plain collectons as it does not contain abc. This fixes issue introduced by: ebe462fc
-
- Aug 26, 2020
-
-
Štěpán Henek authored
-
Karel Koci authored
Added * EUci support for IP address parsing Fixed * Use of deprecated and in Python 3.9 removed library
-
``` tests/euci_test.py::test_get_string /home/stepan/project/pyuci/euci/__init__.py:34: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working return isinstance(data, collections.Iterable) and not isinstance(data, str) ```
-
- Jul 15, 2020
-
-
Štěpán Henek authored
Note that user can use dtype=IPv6Address or dtype=IPv4Address the result will be IPv4Address or IPv6Address regardless of dtype settings.
-
- Dec 04, 2019
-
-
- Dec 03, 2019
-
-
Karel Koci authored
This allows them to be accessible by user if he does not want or can't use automatic conversion in euci.
-
- Nov 26, 2019
-
-
Karel Koci authored
When non-tuple default was passed it just converted it to string instead of iterating over its content.
-
- Jun 06, 2019
-
-
Karel Koci authored
- Jun 05, 2019
-
-
Karel Koci authored
We were checking if argument is list or tuple but that is technically wrong. Much better is to just check if it is iterable. Problem is that string is also iterable but that we can just do as an exception.
-
- May 30, 2019
-
-
Karel Koci authored
-
- May 29, 2019
-
-
Karel Koci authored
Idea of this is that user can set to configuration file instead of list option but we want to make sure that even if he does that that we get tuple of values. This is exactly for that case. Setting list to True ensures that get never returns anything else then list. Where on the other hand setting list to False causes it to never return tuple even if value is lists (in which case first found list is returned).
-
Karel Koci authored
This fixes handling of lists in euci.
-
Karel Koci authored
-
Karel Koci authored
This is much more versatile and compact syntax. You can optionally set default keywords argument and that gives you behavior where UciExceptionNotFound is never thrown out. This also adds tests for defaults.
-
Karel Koci authored
This drops previous get_t and set_t methods in favor of overloaded get and set methods. You can optionally add keyword argument dtype to get method to ensure that returned data is of specified type. For now only str, int and bool are supported. set methods now detects value argument type and behaves according to it. In general it just converts value to string but in case of bool it replaces it with defined value.
-