Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create properites for item_to_log #108

Open
bandophahita opened this issue Sep 28, 2023 · 0 comments
Open

create properites for item_to_log #108

bandophahita opened this issue Sep 28, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@bandophahita
Copy link
Contributor

bandophahita commented Sep 28, 2023

Assuming we don't completely overhaul the way beat messages are handled; there are several classes that transform the argument for proper logging. The arguments are transformed in the constructor which in most cases is sufficient but should the tester ever want to manipulate the attribute after the object has been instantiated the logging will not match.

example:

class MakeNote:
    def describe(self: SelfMakeNote) -> str:
        return f"Make a note under {represent_prop(self.key)}."

    @beat("{} jots something down under {key_to_log}.")
    def perform_as(self: SelfMakeNote, the_actor: Actor) -> None:
        ...

    def __init__(
        self: SelfMakeNote,
        question: T_Q,
        key: Optional[str] = None,
    ) -> None:
        self.question = question
        self.key = key
        self.key_to_log = represent_prop(key)

These attributes should be turned into a more dynamic property.

@bandophahita bandophahita added the enhancement New feature or request label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant