Revert "refactor: rename abstract to generic"

This reverts commit 89d30eb23d.

Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com>
This commit is contained in:
Alexander Tkachev 2022-07-25 00:32:16 +03:00
parent ea19f7dbd6
commit f47087d490
8 changed files with 13 additions and 13 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -21,10 +21,10 @@ from cloudevents.http.event import CloudEvent
from cloudevents.sdk import types
# backwards compatability imports
from cloudevents.generic.http_methods import to_binary, to_structured # noqa
from cloudevents.abstract.http_methods import to_binary, to_structured # noqa
from cloudevents.generic.http_methods import from_http as _generic_from_http
from cloudevents.abstract.http_methods import from_http as _abstract_from_http
def from_http(
@ -43,7 +43,7 @@ def from_http(
e.g. lambda x: x or lambda x: json.loads(x)
:type data_unmarshaller: types.UnmarshallerType
"""
return _generic_from_http(CloudEvent, headers, data, data_unmarshaller)
return _abstract_from_http(CloudEvent, headers, data, data_unmarshaller)
@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
# backwards compatibility
from cloudevents.generic.json_methods import to_json # noqa
from cloudevents.generic.json_methods import from_json as _generic_from_json
from cloudevents.abstract.json_methods import to_json # noqa
from cloudevents.abstract.json_methods import from_json as _abstract_from_json
def from_json(
@ -34,4 +34,4 @@ def from_json(
:type data_unmarshaller: typing.Callable
:returns: CloudEvent representing given cloudevent json object
"""
return _generic_from_json(CloudEvent, data, data_unmarshaller)
return _abstract_from_json(CloudEvent, data, data_unmarshaller)

View File

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