Revert "refactor: rename abstract to generic"
This reverts commit 89d30eb23d
.
Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com>
This commit is contained in:
parent
ea19f7dbd6
commit
f47087d490
|
@ -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
|
|
@ -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
|
|
@ -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(
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from cloudevents.generic import CloudEvent
|
||||
from cloudevents.abstract import CloudEvent
|
||||
import pytest
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue