From b059125991fc44273b4023df1fd9da5138a1fc0c Mon Sep 17 00:00:00 2001 From: nocturn9x Date: Thu, 19 Mar 2020 18:48:24 +0000 Subject: [PATCH] Improved features, still needs fix --- __init__.py | 2 -- giambio/__init__.py | 4 +++ giambio.py => giambio/core.py | 49 +++++++++++++++++++------- exceptions.py => giambio/exceptions.py | 3 ++ setup.py | 22 ++++++++++++ test.py | 47 ++++++++++++++++++++++++ 6 files changed, 112 insertions(+), 15 deletions(-) delete mode 100644 __init__.py create mode 100644 giambio/__init__.py rename giambio.py => giambio/core.py (81%) rename exceptions.py => giambio/exceptions.py (62%) create mode 100644 setup.py create mode 100644 test.py diff --git a/__init__.py b/__init__.py deleted file mode 100644 index 6c76eaa..0000000 --- a/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -__author__ = "Nocturn9x aka Isgiambyy" -__version__ = (0, 0, 1) diff --git a/giambio/__init__.py b/giambio/__init__.py new file mode 100644 index 0000000..85e1cbb --- /dev/null +++ b/giambio/__init__.py @@ -0,0 +1,4 @@ +__author__ = "Nocturn9x aka Isgiambyy" +__version__ = (0, 0, 1) +from .core import EventLoop, join, sleep +__all__ = ["EventLoop", "join", "sleep"] diff --git a/giambio.py b/giambio/core.py similarity index 81% rename from giambio.py rename to giambio/core.py index 8c0a255..2715da7 100644 --- a/giambio.py +++ b/giambio/core.py @@ -27,16 +27,24 @@ class Task: def __init__(self, coroutine: types.coroutine): self.coroutine = coroutine + self.status = False # Not ran yet + self.joined = False def run(self): + self.status = True return self.coroutine.send(None) + def __repr__(self): + return f"