diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2021-09-19 19:43:11 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2021-09-19 19:43:11 +0200 |
commit | 7bdce37fd3f18e2712e18c4e2c64cac69af0aca1 (patch) | |
tree | b7ad3f1cca92e2dfd2664ae9e65652bd03ff58b2 /src/compileAndRun/pythonSupportFiles/entry.py | |
parent | e6880cd8ccf82d993f222cb14b4860581654acb8 (diff) | |
download | Luxcena-Neo-7bdce37fd3f18e2712e18c4e2c64cac69af0aca1.tar.gz Luxcena-Neo-7bdce37fd3f18e2712e18c4e2c64cac69af0aca1.zip |
:boom: Introduce new UI based on svelte, and rewrite a lot of the node app and the NeoRuntime
Diffstat (limited to 'src/compileAndRun/pythonSupportFiles/entry.py')
-rw-r--r-- | src/compileAndRun/pythonSupportFiles/entry.py | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/src/compileAndRun/pythonSupportFiles/entry.py b/src/compileAndRun/pythonSupportFiles/entry.py deleted file mode 100644 index 45de822..0000000 --- a/src/compileAndRun/pythonSupportFiles/entry.py +++ /dev/null @@ -1,76 +0,0 @@ -# This is the entry-point for all Luxcena-Neo python-scripts -# The script should be in the same folder as this, and be named "script.py" -# In the future you could possibly have more files and stuff alongside the "script.py"-file as well -import sys -import json -import importlib -import datetime - -def runSync(moduleSc, sc): - timeNow = datetime.datetime.now() - lastDay = timeNow.day - lastHour = timeNow.hour - lastMinute = timeNow.minute - lastSecond = timeNow.second - - while True: - timeNow = datetime.datetime.now() - - if ("LuxcenaNeo" in dir(moduleSc)): - if moduleSc.LuxcenaNeo.forceStop: break - elif ("neo" in dir(moduleSc)): - if moduleSc.neo.forceStop == True: break - - if (timeNow.second != lastSecond): - lastSecond = timeNow.second - sc.eachSecond() - - if (timeNow.minute != lastMinute): - lastMinute = timeNow.minute - sc.eachMinute() - - if (timeNow.hour != lastHour): - lastHour = timeNow.hour - sc.eachHour() - - if (timeNow.day != lastDay): - lastDay = timeNow.lastDay - sc.eachDay() - -def runAsync(moduleSc, sc): - return - -def main(): - print ("Starting script named \"{0}\"".format("test")) - - root_dir = sys.argv[1] - config_dir = root_dir + "/config/" - - print ("> Loading pixel-configuration...") - with open(config_dir + "strip.json", "r") as rawStripConf: - stripConf = json.load(rawStripConf) - - print ("> Initializing script...") - moduleSc = importlib.import_module("script") - - if ("LuxcenaNeo" in dir(moduleSc)): - moduleSc.LuxcenaNeo.strip = moduleSc.LuxcenaNeo.Strip(stripConf) - elif ("neo" in dir(moduleSc)): - moduleSc.neo.strip = moduleSc.neo.Strip(stripConf) - else: - raise Exception("Neither LuxcenaNeo nor neo found in script, check docs!") - - sc = moduleSc.Main() - - print ("> Running the script...") - sc.onStart() - - if (("async" in dir(moduleSc)) and (moduleSc.async == True)): - runAsync(moduleSc, sc) - else: - runSync(moduleSc, sc) - - print ("> Script exited...") - -if __name__ == "__main__": - main() |