-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
1 changed file
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters