Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #85 from astrojuanlu/keep-repr
Browse files Browse the repository at this point in the history
Replace repr by str
  • Loading branch information
astrojuanlu authored Dec 26, 2020
2 parents c1af82d + 1e91995 commit 901dc71
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 126 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ When using czml3 in an interactive interpreter,
all objects show as nice CZML (JSON)::

>>> from czml3 import Packet
>>> Packet()
>>> print(Packet())
{
"id": "adae4d3a-7087-4fda-a70b-d18a262a890e"
}
>>> packet0 = Packet(id="Facility/AGI", name="AGI")
>>> packet0
>>> print(packet0)
{
"id": "Facility/AGI",
"name": "AGI"
Expand All @@ -70,7 +70,7 @@ all objects show as nice CZML (JSON)::
And there are more complex examples available::

>>> from czml3.examples import simple
>>> simple
>>> print(simple)
[
{
"id": "document",
Expand Down
4 changes: 2 additions & 2 deletions src/czml3/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def default(self, o):
return super().default(o)


@attr.s(repr=False, frozen=True)
@attr.s(str=False, frozen=True)
class BaseCZMLObject:
def __repr__(self):
def __str__(self):
return self.dumps(indent=4)

def dumps(self, *args, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions src/czml3/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from .enums import HorizontalOrigins, InterpolationAlgorithms, VerticalOrigins


@attr.s(repr=False, frozen=True, kw_only=True)
@attr.s(str=False, frozen=True, kw_only=True)
class Deletable:
"""A property whose value may be deleted."""

delete: bool = attr.ib(default=None)


# noinspection PyPep8Naming
@attr.s(repr=False, frozen=True, kw_only=True)
@attr.s(str=False, frozen=True, kw_only=True)
class Interpolatable:
"""A property whose value may be determined by interpolating.
Expand All @@ -27,7 +27,7 @@ class Interpolatable:


# noinspection PyPep8Naming
@attr.s(repr=False, frozen=True, kw_only=True)
@attr.s(str=False, frozen=True, kw_only=True)
class HasAlignment:
"""A property that can be horizontally or vertically aligned."""

Expand Down
6 changes: 3 additions & 3 deletions src/czml3/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
CZML_VERSION = "1.0"


@attr.s(repr=False, frozen=True, kw_only=True)
@attr.s(str=False, frozen=True, kw_only=True)
class Preamble(BaseCZMLObject):
"""The preamble packet."""

Expand All @@ -20,7 +20,7 @@ class Preamble(BaseCZMLObject):
clock = attr.ib(default=None)


@attr.s(repr=False, frozen=True, kw_only=True)
@attr.s(str=False, frozen=True, kw_only=True)
class Packet(BaseCZMLObject):
"""A CZML Packet.
Expand Down Expand Up @@ -55,7 +55,7 @@ class Packet(BaseCZMLObject):
wall = attr.ib(default=None)


@attr.s(repr=False, frozen=True)
@attr.s(str=False, frozen=True)
class Document(Sequence):
"""A CZML document, consisting on a list of packets."""

Expand Down
Loading

0 comments on commit 901dc71

Please sign in to comment.