mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-25 17:27:31 +00:00
cosmetic: spaces, typos
This commit is contained in:
parent
fd5019a7b2
commit
215ccaebea
1 changed files with 7 additions and 7 deletions
|
@ -79,7 +79,7 @@ def fix_tuple_of_str(v):
|
||||||
|
|
||||||
|
|
||||||
def fix_tuple_of_str_and_int(v):
|
def fix_tuple_of_str_and_int(v):
|
||||||
"""make sure we have a tuple of str"""
|
"""make sure we have a tuple of str or int"""
|
||||||
assert isinstance(v, (tuple, list))
|
assert isinstance(v, (tuple, list))
|
||||||
t = tuple(e.decode() if isinstance(e, bytes) else e for e in v)
|
t = tuple(e.decode() if isinstance(e, bytes) else e for e in v)
|
||||||
assert all(isinstance(e, (str, int)) for e in t), repr(t)
|
assert all(isinstance(e, (str, int)) for e in t), repr(t)
|
||||||
|
@ -127,11 +127,11 @@ cdef class PropDict:
|
||||||
- be safe against typos in key names: check against VALID_KEYS
|
- be safe against typos in key names: check against VALID_KEYS
|
||||||
- when setting a value: check type of value
|
- when setting a value: check type of value
|
||||||
|
|
||||||
When "packing" a dict, ie. you have a dict with some data and want to convert it into an instance,
|
When "packing" a dict, i.e. you have a dict with some data and want to convert it into an instance,
|
||||||
then use eg. Item({'a': 1, ...}). This way all keys in your dictionary are validated.
|
then use e.g. Item({'a': 1, ...}). This way all keys in your dictionary are validated.
|
||||||
|
|
||||||
When "unpacking", that is you've read a dictionary with some data from somewhere (eg. msgpack),
|
When "unpacking", that is you've read a dictionary with some data from somewhere (e.g. msgpack),
|
||||||
then use eg. Item(internal_dict={...}). This does not validate the keys, therefore unknown keys
|
then use e.g. Item(internal_dict={...}). This does not validate the keys, therefore unknown keys
|
||||||
are ignored instead of causing an error.
|
are ignored instead of causing an error.
|
||||||
"""
|
"""
|
||||||
VALID_KEYS = frozenset() # override with <set of str> in child class
|
VALID_KEYS = frozenset() # override with <set of str> in child class
|
||||||
|
|
Loading…
Reference in a new issue