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

Get rid of object IDs in the main script #694

Open
ZdenekM opened this issue Dec 28, 2021 · 0 comments
Open

Get rid of object IDs in the main script #694

ZdenekM opened this issue Dec 28, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@ZdenekM
Copy link
Member

ZdenekM commented Dec 28, 2021

One solution would be to generate a class with object names as properties. So this:

def main(res: Resources) -> None:
    time_actions: TimeActions = res.objects['obj_085380112a824d8eb0ebd6ed83fa27e8']
    
    while True:
        time_actions.sleep(1.0, an='sleep')

would become:

def main(res: Resources) -> None:
    
    while True:
        objects.time_actions.sleep(1.0, an='sleep')

...which is probably a bit friendlier.

Another alternative would be something like this:

def main(res: Resources) -> None:
    time_actions: TimeActions = res.objects['time_actions']
    
    while True:
        time_actions.sleep(1.0, an='sleep')
@ZdenekM ZdenekM added the enhancement New feature or request label Dec 28, 2021
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