diff --git a/fishery/__main__.py b/fishery/__main__.py index e3c75f5a..1091a31d 100644 --- a/fishery/__main__.py +++ b/fishery/__main__.py @@ -98,6 +98,8 @@ def callback(): else: self.showtraceback() +from sys import argv +print(f"File name: {argv[0]}") class REPLThread(threading.Thread): def run(self): diff --git a/sardine/__init__.py b/sardine/__init__.py index a3528bd4..d12930da 100644 --- a/sardine/__init__.py +++ b/sardine/__init__.py @@ -326,6 +326,11 @@ def __exit__(self, exc_type, exc_val, exc_tb): sleep(self.duration) +from sys import argv +hook_path = argv[0] +if "__main__.py" in hook_path: + os.environ['SARDINE_INIT_SESSION'] = 'YES' + if ( os.getenv("SARDINE_INIT_SESSION") is not None and os.getenv("SARDINE_INIT_SESSION") == "YES"