|
@@ -3,12 +3,12 @@
|
|
import stat
|
|
import stat
|
|
from collections import namedtuple
|
|
from collections import namedtuple
|
|
|
|
|
|
-from .constants import ITEM_KEYS
|
|
|
|
|
|
+from .constants import ITEM_KEYS, ARCHIVE_KEYS
|
|
from .helpers import safe_encode, safe_decode
|
|
from .helpers import safe_encode, safe_decode
|
|
from .helpers import bigint_to_int, int_to_bigint
|
|
from .helpers import bigint_to_int, int_to_bigint
|
|
from .helpers import StableDict
|
|
from .helpers import StableDict
|
|
|
|
|
|
-API_VERSION = '1.1_02'
|
|
|
|
|
|
+API_VERSION = '1.1_03'
|
|
|
|
|
|
|
|
|
|
class PropDict:
|
|
class PropDict:
|
|
@@ -292,10 +292,7 @@ class ArchiveItem(PropDict):
|
|
If a ArchiveItem shall be serialized, give as_dict() method output to msgpack packer.
|
|
If a ArchiveItem shall be serialized, give as_dict() method output to msgpack packer.
|
|
"""
|
|
"""
|
|
|
|
|
|
- VALID_KEYS = {'version', 'name', 'items', 'cmdline', 'hostname', 'username', 'time', 'time_end',
|
|
|
|
- 'comment', 'chunker_params',
|
|
|
|
- 'recreate_cmdline', 'recreate_source_id', 'recreate_args', 'recreate_partial_chunks',
|
|
|
|
- } # str-typed keys
|
|
|
|
|
|
+ VALID_KEYS = ARCHIVE_KEYS # str-typed keys
|
|
|
|
|
|
__slots__ = ("_dict", ) # avoid setting attributes not supported by properties
|
|
__slots__ = ("_dict", ) # avoid setting attributes not supported by properties
|
|
|
|
|
|
@@ -309,8 +306,9 @@ class ArchiveItem(PropDict):
|
|
time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
|
|
time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
|
|
comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
|
|
comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
|
|
chunker_params = PropDict._make_property('chunker_params', tuple)
|
|
chunker_params = PropDict._make_property('chunker_params', tuple)
|
|
- recreate_source_id = PropDict._make_property('recreate_source_id', bytes)
|
|
|
|
recreate_cmdline = PropDict._make_property('recreate_cmdline', list) # list of s-e-str
|
|
recreate_cmdline = PropDict._make_property('recreate_cmdline', list) # list of s-e-str
|
|
|
|
+ # recreate_source_id, recreate_args, recreate_partial_chunks were used in 1.1.0b1 .. b2
|
|
|
|
+ recreate_source_id = PropDict._make_property('recreate_source_id', bytes)
|
|
recreate_args = PropDict._make_property('recreate_args', list) # list of s-e-str
|
|
recreate_args = PropDict._make_property('recreate_args', list) # list of s-e-str
|
|
recreate_partial_chunks = PropDict._make_property('recreate_partial_chunks', list) # list of tuples
|
|
recreate_partial_chunks = PropDict._make_property('recreate_partial_chunks', list) # list of tuples
|
|
|
|
|