Skip to content

Commit 89d30eb

Browse files
committed
refactor: rename abstract to generic
Signed-off-by: Alexander Tkachev <sasha64sasha@gmail.com>
1 parent a22efbd commit 89d30eb

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

cloudevents/abstract/__init__.py renamed to cloudevents/generic/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
from cloudevents.abstract.event import CloudEvent, AnyCloudEvent # noqa
15+
from cloudevents.generic.event import CloudEvent, AnyCloudEvent # noqa
File renamed without changes.

cloudevents/abstract/http_methods.py renamed to cloudevents/generic/http_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
import cloudevents.exceptions as cloud_exceptions
20-
from cloudevents.abstract.event import AnyCloudEvent
20+
from cloudevents.generic.event import AnyCloudEvent
2121
from cloudevents.http.event_type import is_binary
2222
from cloudevents.http.mappings import _marshaller_by_format, _obj_by_version
2323
from cloudevents.http.util import _json_or_string

cloudevents/abstract/json_methods.py renamed to cloudevents/generic/json_methods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
import typing
1616

17-
from cloudevents.abstract import AnyCloudEvent
17+
from cloudevents.generic import AnyCloudEvent
1818
from cloudevents.sdk import types
19-
from cloudevents.abstract.http_methods import to_structured, from_http
19+
from cloudevents.generic.http_methods import to_structured, from_http
2020

2121

2222
def to_json(

cloudevents/http/event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
import cloudevents.exceptions as cloud_exceptions
2020
from cloudevents.http.mappings import _required_by_version
21-
from cloudevents import abstract
21+
from cloudevents import generic
2222

2323

24-
class CloudEvent(abstract.CloudEvent):
24+
class CloudEvent(generic.CloudEvent):
2525
"""
2626
Python-friendly cloudevent class supporting v1 events
2727
Supports both binary and structured mode CloudEvents

cloudevents/http/http_methods.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
from cloudevents.sdk import types
2222

2323
# backwards compatability imports
24-
from cloudevents.abstract.http_methods import to_binary, to_structured # noqa
24+
from cloudevents.generic.http_methods import to_binary, to_structured # noqa
2525

2626

27-
from cloudevents.abstract.http_methods import from_http as _abstract_from_http
27+
from cloudevents.generic.http_methods import from_http as _generic_from_http
2828

2929

3030
def from_http(
@@ -43,7 +43,7 @@ def from_http(
4343
e.g. lambda x: x or lambda x: json.loads(x)
4444
:type data_unmarshaller: types.UnmarshallerType
4545
"""
46-
return _abstract_from_http(CloudEvent, headers, data, data_unmarshaller)
46+
return _generic_from_http(CloudEvent, headers, data, data_unmarshaller)
4747

4848

4949
@deprecated(deprecated_in="1.0.2", details="Use to_binary function instead")

cloudevents/http/json_methods.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
from cloudevents.sdk import types
1919

2020
# backwards compatibility
21-
from cloudevents.abstract.json_methods import to_json # noqa
22-
from cloudevents.abstract.json_methods import from_json as _abstract_from_json
21+
from cloudevents.generic.json_methods import to_json # noqa
22+
from cloudevents.generic.json_methods import from_json as _generic_from_json
2323

2424

2525
def from_json(
@@ -34,4 +34,4 @@ def from_json(
3434
:type data_unmarshaller: typing.Callable
3535
:returns: CloudEvent representing given cloudevent json object
3636
"""
37-
return _abstract_from_json(CloudEvent, data, data_unmarshaller)
37+
return _generic_from_json(CloudEvent, data, data_unmarshaller)

cloudevents/tests/test_abstract_cloudevent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from cloudevents.abstract import CloudEvent
1+
from cloudevents.generic import CloudEvent
22
import pytest
33

44

0 commit comments

Comments
 (0)