From 96b1480063fd0b7053e034335e7440472206753b Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Thu, 5 Jan 2012 18:38:04 -0800 Subject: [PATCH] Fixed so that SWF compiles on Windows --- lightningbeam | 4 ++-- svlgui.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lightningbeam b/lightningbeam index 4bc7eee..35cc524 100644 --- a/lightningbeam +++ b/lightningbeam @@ -113,8 +113,8 @@ def create_sc(root): def run_file(self=None): global root print "RUNNING" - open("/Users/skyler/Desktop/test.sc", "w").write(create_sc(root)) - svlgui.execute("swfc/swfc_osx /Users/skyler/Desktop/test.sc -o /Users/skyler/Desktop/test.swf") + open("test.sc", "w").write(create_sc(root)) + svlgui.execute("swfc/swfc_"+svlgui.PLATFORM+" test.sc -o test.swf") def box(x, y, width, height, fill=None): diff --git a/svlgui.py b/svlgui.py index 4ad314c..0839e1b 100644 --- a/svlgui.py +++ b/svlgui.py @@ -107,6 +107,7 @@ FILLCOLOR = Color("#000000") #Magic. Detect platform and select appropriate toolkit. To be used throughout code. if sys.platform=="linux2": + PLATFORM="linux32" import gtk import cairo import gobject @@ -133,6 +134,7 @@ if sys.platform=="linux2": jsfunctions = ""''' sep = "/" elif sys.platform=="win32": + PLATFORM="win32" import pickle import misc_funcs import GUI # Using PyGUI. Experimental. @@ -152,6 +154,7 @@ elif sys.platform=="linux-armv6l": sep = "/" print str(sys.platform) elif sys.platform=="darwin": + PLATFORM="osx" import pickle import misc_funcs import GUI # Using PyGUI. Experimental. @@ -627,7 +630,7 @@ class Canvas(Widget): self.invalidate_rect([0,0,self.extent[0],self.extent[1]]) def key_up(self, event): - print ord(event.unichars) + pass self.canvas = OSXCanvas(extent = (width, height), scrolling = 'hv') self.canvas.objs = self.objs elif SYSTEM=="html": @@ -1578,7 +1581,7 @@ def alert(text,critical=False): jscommunicate("window.location.reload()") def execute(command): - os.system(command) + os.system(command.replace("/",sep)) class OverlayWindow: if SYSTEM=="gtk":