mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-10-25 18:40:17 -04:00
Updated tests init
This commit is contained in:
parent
75cbc73f64
commit
e714c559cc
1 changed files with 5 additions and 25 deletions
|
|
@ -1,26 +1,6 @@
|
|||
compiling = False
|
||||
noticed = False
|
||||
notice_delay = 0.3
|
||||
import time
|
||||
import sys
|
||||
import threading
|
||||
from importlib.util import find_spec
|
||||
if find_spec("pyximport") and find_spec("cython"):
|
||||
import pyximport; pyxloader = pyximport.install(pyimport=True, language_level=3)[1]
|
||||
import os
|
||||
if os.environ.get("RNS_COMPILE"): from CRNS import RNS
|
||||
else: import RNS
|
||||
|
||||
def notice_job():
|
||||
global noticed
|
||||
started = time.time()
|
||||
while compiling:
|
||||
if time.time() > started+notice_delay and compiling:
|
||||
noticed = True
|
||||
print("Compiling RNS object code... ", end="")
|
||||
sys.stdout.flush()
|
||||
break
|
||||
time.sleep(0.1)
|
||||
|
||||
|
||||
compiling = True
|
||||
threading.Thread(target=notice_job, daemon=True).start()
|
||||
import RNS; compiling = False
|
||||
if noticed: print("Done."); sys.stdout.flush()
|
||||
notice = f"Starting tests in {'compiled' if RNS.compiled else 'interpreted'} mode"
|
||||
print(f"\n{notice}\n"+"="*len(notice)+"\n\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue