acstore
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: acstore | ||
| Version: 20240406 | ||
| Version: 20240407 | ||
| Summary: Attribute Container Storage (ACStore). | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/log2timeline/acstore |
@@ -8,2 +8,2 @@ # -*- coding: utf-8 -*- | ||
| __version__ = '20240406' | ||
| __version__ = '20240407' |
| # -*- coding: utf-8 -*- | ||
| """Attribute container JSON serializer.""" | ||
| from acstore.containers import interface as containers_interface | ||
| from acstore.containers import manager as containers_manager | ||
@@ -48,8 +49,11 @@ from acstore.helpers import schema as schema_helper | ||
| data_type = schema.get(attribute_name, None) | ||
| serializer = schema_helper.SchemaHelper.GetAttributeSerializer( | ||
| data_type, 'json') | ||
| if data_type == 'AttributeContainerIdentifier' and isinstance( | ||
| attribute_value, containers_interface.AttributeContainerIdentifier): | ||
| attribute_value = attribute_value.CopyToString() | ||
| else: | ||
| serializer = schema_helper.SchemaHelper.GetAttributeSerializer( | ||
| data_type, 'json') | ||
| if serializer: | ||
| attribute_value = serializer.SerializeValue(attribute_value) | ||
| if serializer: | ||
| attribute_value = serializer.SerializeValue(attribute_value) | ||
| # JSON will not serialize certain runtime types like set, therefore | ||
@@ -108,10 +112,14 @@ # these are cast to list first. | ||
| data_type = schema.get(attribute_name, None) | ||
| serializer = schema_helper.SchemaHelper.GetAttributeSerializer( | ||
| data_type, 'json') | ||
| if data_type == 'AttributeContainerIdentifier': | ||
| identifier = containers_interface.AttributeContainerIdentifier() | ||
| identifier.CopyFromString(attribute_value) | ||
| attribute_value = identifier | ||
| else: | ||
| serializer = schema_helper.SchemaHelper.GetAttributeSerializer( | ||
| data_type, 'json') | ||
| if serializer: | ||
| attribute_value = serializer.DeserializeValue(attribute_value) | ||
| if serializer: | ||
| attribute_value = serializer.DeserializeValue(attribute_value) | ||
| setattr(attribute_container, attribute_name, attribute_value) | ||
| return attribute_container |
@@ -183,20 +183,12 @@ # -*- coding: utf-8 -*- | ||
| # is able to append (write). | ||
| _APPEND_COMPATIBLE_FORMAT_VERSION = 20221023 | ||
| _APPEND_COMPATIBLE_FORMAT_VERSION = 20230312 | ||
| # The earliest format version, stored in-file, that this class | ||
| # is able to upgrade (write new format features). | ||
| _UPGRADE_COMPATIBLE_FORMAT_VERSION = 20221023 | ||
| _UPGRADE_COMPATIBLE_FORMAT_VERSION = 20230312 | ||
| # The earliest format version, stored in-file, that this class | ||
| # is able to read. | ||
| _READ_COMPATIBLE_FORMAT_VERSION = 20221023 | ||
| _READ_COMPATIBLE_FORMAT_VERSION = 20230312 | ||
| # TODO: kept for backwards compatibility. | ||
| _CONTAINER_SCHEMA_TO_SQLITE_TYPE_MAPPINGS = { | ||
| 'AttributeContainerIdentifier': 'TEXT', | ||
| 'bool': 'INTEGER', | ||
| 'int': 'INTEGER', | ||
| 'str': 'TEXT', | ||
| 'timestamp': 'BIGINT'} | ||
| _CREATE_METADATA_TABLE_QUERY = ( | ||
@@ -203,0 +195,0 @@ 'CREATE TABLE metadata (key TEXT, value TEXT);') |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: acstore | ||
| Version: 20240406 | ||
| Version: 20240407 | ||
| Summary: Attribute Container Storage (ACStore). | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/log2timeline/acstore |
+1
-1
| [metadata] | ||
| name = acstore | ||
| version = 20240406 | ||
| version = 20240407 | ||
| description = Attribute Container Storage (ACStore). | ||
@@ -5,0 +5,0 @@ long_description = ACStore, or Attribute Container Storage, provides a stand-alone implementation to read and write attribute container storage files. |
Sorry, the diff of this file is not supported yet
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
206460
0.14%3344
0.09%