Skip to content

Commit

Permalink
template entry point is working.
Browse files Browse the repository at this point in the history
entry.py allows us to import as if we're using a module
  • Loading branch information
SimonNordon4 committed Aug 5, 2024
1 parent 5f30215 commit 58f6dd8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
7 changes: 5 additions & 2 deletions entry_point.py → entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
sys.path.insert(0, script_dir)
__package__ = os.path.basename(script_dir)

from .template import __init__
import hello_world.__init__

__init__.test()
if "auto_load" in locals():
importlib.reload(hello_world.__init__)

hello_world.__init__.register()
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions template/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# import auto_load
import auto_load

# auto_load.init()
auto_load.init()

# def register():
# auto_load.register()
def register():
auto_load.register()

# def unregister():
# auto_load.unregister()
def unregister():
auto_load.unregister()

print("Hello from __init__.py")

def test():
print("Hello from __init__.py test()")


0 comments on commit 58f6dd8

Please sign in to comment.