From 84c148f1a8daf416f7fa45bbfd1dbd60145bfc4a Mon Sep 17 00:00:00 2001 From: Ryan Kirkbride Date: Thu, 23 Jan 2020 18:34:40 +0000 Subject: [PATCH] Remove import * from Workspace to allow non gui foxdot to run without Tk --- FoxDot/__init__.py | 6 +----- FoxDot/__main__.py | 3 +-- FoxDot/lib/TempoClock.py | 1 - FoxDot/lib/Workspace/Editor.py | 2 +- FoxDot/lib/Workspace/Prompt.py | 3 ++- FoxDot/lib/Workspace/__init__.py | 3 --- FoxDot/lib/Workspace/tmp/tempfile.txt | 13 ------------- FoxDot/lib/__init__.py | 1 - 8 files changed, 5 insertions(+), 27 deletions(-) diff --git a/FoxDot/__init__.py b/FoxDot/__init__.py index 767dd141..c48d67dc 100644 --- a/FoxDot/__init__.py +++ b/FoxDot/__init__.py @@ -47,8 +47,6 @@ def boot_supercollider(): if(OS == "Windows"): - print("OS: Windows") - sclangloc = os.popen('where /R "C:\\Program Files" sclang.exe').read() thiscwd = str(sclangloc) @@ -75,8 +73,6 @@ def is_proc_running(name): elif(OS == "Linux"): - print("OS: Linux") - def is_proc_running(name): for p in psutil.process_iter(attrs=["name","cmdline"]): #print(p); @@ -111,7 +107,7 @@ def is_proc_running(name): def main(): """ Function for starting the GUI when importing the library """ - FoxDot = Workspace.workspace(FoxDotCode).run() + FoxDot = Workspace.Editor.workspace(FoxDotCode).run() def Go(): """ Function to be called at the end of Python files with FoxDot code in to keep diff --git a/FoxDot/__main__.py b/FoxDot/__main__.py index 9fa0db1d..36f1c90b 100644 --- a/FoxDot/__main__.py +++ b/FoxDot/__main__.py @@ -12,7 +12,6 @@ from __future__ import absolute_import, division, print_function from .lib import FoxDotCode, handle_stdin -from .lib.Workspace import workspace import argparse @@ -80,6 +79,6 @@ else: - from .lib.Workspace import workspace + from .lib.Workspace.Editor import workspace FoxDot = workspace(FoxDotCode).run() diff --git a/FoxDot/lib/TempoClock.py b/FoxDot/lib/TempoClock.py index c37b0e2e..a44156df 100644 --- a/FoxDot/lib/TempoClock.py +++ b/FoxDot/lib/TempoClock.py @@ -182,7 +182,6 @@ def reset(self): self.time = self.dtype(0) self.beat = self.dtype(0) self.start_time = time.time() - print("resetting clock") return @classmethod diff --git a/FoxDot/lib/Workspace/Editor.py b/FoxDot/lib/Workspace/Editor.py index b95ab5aa..4a5e41f6 100644 --- a/FoxDot/lib/Workspace/Editor.py +++ b/FoxDot/lib/Workspace/Editor.py @@ -1195,7 +1195,7 @@ def select_all(self, event=None): def killall(self, event=None): """ Stops all player objects """ execute("_Clock.clear()", verbose=False) - print("Clearing the scheduling clock.") + print("Clock.clear()") return "break" # Zoom in: Ctrl+= diff --git a/FoxDot/lib/Workspace/Prompt.py b/FoxDot/lib/Workspace/Prompt.py index 98dd5eb6..ea303c85 100644 --- a/FoxDot/lib/Workspace/Prompt.py +++ b/FoxDot/lib/Workspace/Prompt.py @@ -16,7 +16,8 @@ def __init__(self, root): # TODO // sort out the name space to check for suggestions - keywords = list(self.root.namespace["get_keywords"]()) + # keywords = list(self.root.namespace["get_keywords"]()) + keywords = list(get_keywords()) synthdefs = list(self.root.namespace["SynthDefs"]) attributes = list(self.root.namespace["Player"].get_attributes()) player_methods = ["every", "often", "sometimes", "rarely"] diff --git a/FoxDot/lib/Workspace/__init__.py b/FoxDot/lib/Workspace/__init__.py index 13f269ed..e69de29b 100644 --- a/FoxDot/lib/Workspace/__init__.py +++ b/FoxDot/lib/Workspace/__init__.py @@ -1,3 +0,0 @@ -from __future__ import absolute_import, division, print_function - -from .Editor import * diff --git a/FoxDot/lib/Workspace/tmp/tempfile.txt b/FoxDot/lib/Workspace/tmp/tempfile.txt index c241bd9d..e69de29b 100644 --- a/FoxDot/lib/Workspace/tmp/tempfile.txt +++ b/FoxDot/lib/Workspace/tmp/tempfile.txt @@ -1,13 +0,0 @@ -Clock.bpm=120 - - - -d1 >> play("<[--]><..H( [ d])>", dur=1/2, cut=.8, hpf=00) - -b1 >> bass(dur=1/2, amp=[0,1], oct=5, drive=0.5, room=0.2, tremolo=1, sus=1).spread() + var([0,5,3],[8,4,4]) - -p1 >> spark(b1.pitch + (0, P*(_,[P*(4,5),4,4]), 2), dur=[8,4,4], oct=6, tremolo=4) - -p2 >> pulse(PRand([4,2,0,6], seed=0)[:16], dur=1/4, oct=4, formant=linvar([0,4],8)).slider().spread() - -nextBar(Clock.clear) \ No newline at end of file diff --git a/FoxDot/lib/__init__.py b/FoxDot/lib/__init__.py index 593a7301..ede97102 100644 --- a/FoxDot/lib/__init__.py +++ b/FoxDot/lib/__init__.py @@ -23,7 +23,6 @@ from .SCLang import SynthDefs, Env, SynthDef, CompiledSynthDef from .Root import Root from .Scale import Scale, Tuning -from .Workspace import get_keywords # stdlib imports