refactor: rename abstract to generic

Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com>
This commit is contained in:
Alexander Tkachev 2022-07-24 23:04:58 +03:00
parent a22efbde37
commit 89d30eb23d
8 changed files with 13 additions and 13 deletions

View File

@ -12,4 +12,4 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from cloudevents.abstract.event import CloudEvent, AnyCloudEvent # noqa from cloudevents.generic.event import CloudEvent, AnyCloudEvent # noqa

View File

@ -17,7 +17,7 @@ import typing
import cloudevents.exceptions as cloud_exceptions import cloudevents.exceptions as cloud_exceptions
from cloudevents.abstract.event import AnyCloudEvent from cloudevents.generic.event import AnyCloudEvent
from cloudevents.http.event_type import is_binary from cloudevents.http.event_type import is_binary
from cloudevents.http.mappings import _marshaller_by_format, _obj_by_version from cloudevents.http.mappings import _marshaller_by_format, _obj_by_version
from cloudevents.http.util import _json_or_string from cloudevents.http.util import _json_or_string

View File

@ -14,9 +14,9 @@
import typing import typing
from cloudevents.abstract import AnyCloudEvent from cloudevents.generic import AnyCloudEvent
from cloudevents.sdk import types from cloudevents.sdk import types
from cloudevents.abstract.http_methods import to_structured, from_http from cloudevents.generic.http_methods import to_structured, from_http
def to_json( def to_json(

View File

@ -18,10 +18,10 @@ import uuid
import cloudevents.exceptions as cloud_exceptions import cloudevents.exceptions as cloud_exceptions
from cloudevents.http.mappings import _required_by_version from cloudevents.http.mappings import _required_by_version
from cloudevents import abstract from cloudevents import generic
class CloudEvent(abstract.CloudEvent): class CloudEvent(generic.CloudEvent):
""" """
Python-friendly cloudevent class supporting v1 events Python-friendly cloudevent class supporting v1 events
Supports both binary and structured mode CloudEvents Supports both binary and structured mode CloudEvents

View File

@ -21,10 +21,10 @@ from cloudevents.http.event import CloudEvent
from cloudevents.sdk import types from cloudevents.sdk import types
# backwards compatability imports # backwards compatability imports
from cloudevents.abstract.http_methods import to_binary, to_structured # noqa from cloudevents.generic.http_methods import to_binary, to_structured # noqa
from cloudevents.abstract.http_methods import from_http as _abstract_from_http from cloudevents.generic.http_methods import from_http as _generic_from_http
def from_http( def from_http(
@ -43,7 +43,7 @@ def from_http(
e.g. lambda x: x or lambda x: json.loads(x) e.g. lambda x: x or lambda x: json.loads(x)
:type data_unmarshaller: types.UnmarshallerType :type data_unmarshaller: types.UnmarshallerType
""" """
return _abstract_from_http(CloudEvent, headers, data, data_unmarshaller) return _generic_from_http(CloudEvent, headers, data, data_unmarshaller)
@deprecated(deprecated_in="1.0.2", details="Use to_binary function instead") @deprecated(deprecated_in="1.0.2", details="Use to_binary function instead")

View File

@ -18,8 +18,8 @@ from cloudevents.http.event import CloudEvent
from cloudevents.sdk import types from cloudevents.sdk import types
# backwards compatibility # backwards compatibility
from cloudevents.abstract.json_methods import to_json # noqa from cloudevents.generic.json_methods import to_json # noqa
from cloudevents.abstract.json_methods import from_json as _abstract_from_json from cloudevents.generic.json_methods import from_json as _generic_from_json
def from_json( def from_json(
@ -34,4 +34,4 @@ def from_json(
:type data_unmarshaller: typing.Callable :type data_unmarshaller: typing.Callable
:returns: CloudEvent representing given cloudevent json object :returns: CloudEvent representing given cloudevent json object
""" """
return _abstract_from_json(CloudEvent, data, data_unmarshaller) return _generic_from_json(CloudEvent, data, data_unmarshaller)

View File

@ -1,4 +1,4 @@
from cloudevents.abstract import CloudEvent from cloudevents.generic import CloudEvent
import pytest import pytest