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

Expose tuber.server.main() for user API #43

Merged
merged 1 commit into from
Sep 12, 2024

Commits on Sep 12, 2024

  1. Expose tuber.server.main() for user API

    This PR allows using the main() function in the `__main__` block of user code.
    For example:
    
    ```
    registry = {"my_object": MyObject()}
    
    if __name__ == "__main__":
        from tuber.server import main
    
        main(registry=registry)
    ```
    
    The registry script then automatically provides the `tuberd` command-line
    interface, with the registry pre-loaded by the user.
    
    This PR also replaces the fragile `exec` call with an importlib interface for
    loading a registry from a file path.
    arahlin committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    d4841a6 View commit details
    Browse the repository at this point in the history