-
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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] | ||
|
||
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() |