Merge branch 'master' of github.com:skykooler/Lightningbeam
This commit is contained in:
commit
8104b1e585
1
kt.py
1
kt.py
|
|
@ -2,6 +2,7 @@ from random import random
|
||||||
from kivy.app import App
|
from kivy.app import App
|
||||||
from kivy.lang import Builder
|
from kivy.lang import Builder
|
||||||
from kivy.uix.widget import Widget
|
from kivy.uix.widget import Widget
|
||||||
|
from kivy.uix.codeinput import CodeInput
|
||||||
from kivy.uix.tabbedpanel import TabbedPanel
|
from kivy.uix.tabbedpanel import TabbedPanel
|
||||||
from kivy.uix.button import Button
|
from kivy.uix.button import Button
|
||||||
from kivy.graphics import Color, Ellipse, Line
|
from kivy.graphics import Color, Ellipse, Line
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
#:kivy 1.0
|
#:kivy 1.0
|
||||||
|
#:import ActionScriptLexer pygments.lexers.ActionScriptLexer
|
||||||
|
|
||||||
<Lightningbeam>:
|
<Lightningbeam>:
|
||||||
do_default_tab: False
|
do_default_tab: False
|
||||||
TabbedPanelItem:
|
TabbedPanelItem:
|
||||||
text: 'Drawing'
|
text: 'Drawing'
|
||||||
BoxLayout:
|
BoxLayout:
|
||||||
orientation: "Vertical"
|
orientation: "vertical"
|
||||||
|
|
||||||
TabbedPanelItem:
|
TabbedPanelItem:
|
||||||
text: 'Tools'
|
text: 'Tools'
|
||||||
|
|
@ -27,6 +28,7 @@
|
||||||
text: "Painbrush"
|
text: "Painbrush"
|
||||||
TabbedPanelItem:
|
TabbedPanelItem:
|
||||||
text: 'ActionScript'
|
text: 'ActionScript'
|
||||||
TextInput:
|
CodeInput:
|
||||||
multiline: True
|
multiline: True
|
||||||
|
lexer: ActionScriptLexer()
|
||||||
font_name: 'UbuntuMono-R.ttf'
|
font_name: 'UbuntuMono-R.ttf'
|
||||||
|
|
@ -3,7 +3,10 @@
|
||||||
# © 2012 Skyler Lehmkuhl
|
# © 2012 Skyler Lehmkuhl
|
||||||
# Released under the GPLv3. For more information, see gpl.txt.
|
# Released under the GPLv3. For more information, see gpl.txt.
|
||||||
|
|
||||||
import os, shutil, tarfile, tempfile, StringIO, urllib, subprocess
|
from __future__ import with_statement
|
||||||
|
|
||||||
|
import os, shutil, tarfile, tempfile, StringIO, urllib, subprocess, sys
|
||||||
|
|
||||||
|
|
||||||
# Workaround for broken menubar under Ubuntu
|
# Workaround for broken menubar under Ubuntu
|
||||||
os.putenv("UBUNTU_MENUPROXY", "0")
|
os.putenv("UBUNTU_MENUPROXY", "0")
|
||||||
|
|
@ -323,7 +326,17 @@ def run_file(self=None):
|
||||||
print "RUNNING"
|
print "RUNNING"
|
||||||
root.descendItem().activelayer.frames[root.descendItem().activelayer.currentframe].actions = MainWindow.scriptwindow.text
|
root.descendItem().activelayer.frames[root.descendItem().activelayer.currentframe].actions = MainWindow.scriptwindow.text
|
||||||
open(os.getenv('HOME')+"/test.sc", "w").write(create_sc(root))
|
open(os.getenv('HOME')+"/test.sc", "w").write(create_sc(root))
|
||||||
svlgui.execute("swfc/swfc_"+svlgui.PLATFORM+" "+os.getenv('HOME')+"/test.sc -o "+os.getenv('HOME')+"/test.swf")
|
# svlgui.execute("swfc/swfc_"+svlgui.PLATFORM+" "+os.getenv('HOME')+"/test.sc -o "+os.getenv('HOME')+"/test.swf")
|
||||||
|
x = os.system("swfc/swfc_"+svlgui.PLATFORM+" "+os.getenv('HOME')+"/test.sc -o "+os.getenv('HOME')+"/test.swf")
|
||||||
|
if sys.version_info < (2, 6):
|
||||||
|
if x==5: # which is the error value returned when linking libjpeg fails
|
||||||
|
if svlgui.alert("You appear to be missing libjpeg. Install it?", confirm=True):
|
||||||
|
os.system("""osascript -e 'do shell script "mkdir -p /usr/local/lib; cp swfc/libjpeg.8.dylib /usr/local/lib" with administrator privileges'""")
|
||||||
|
x = os.system("swfc/swfc_"+svlgui.PLATFORM+" "+os.getenv('HOME')+"/test.sc -o "+os.getenv('HOME')+"/test.swf")
|
||||||
|
if x==5:
|
||||||
|
svlgui.alert("Sorry, something has gone terribly wrong.")
|
||||||
|
else:
|
||||||
|
return
|
||||||
#TODO: Make this cross-platform compatible
|
#TODO: Make this cross-platform compatible
|
||||||
if svlgui.PLATFORM=="win32":
|
if svlgui.PLATFORM=="win32":
|
||||||
# Untested.
|
# Untested.
|
||||||
|
|
@ -344,11 +357,15 @@ def run_file(self=None):
|
||||||
svlgui.alert("Aborting.")
|
svlgui.alert("Aborting.")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
svlgui.alert("The file will download when you click Ok.\nThis may take some time.")
|
svlgui.alert("The Flash Debugger will download when you click Ok.\nThis may take some time.")
|
||||||
urllib.urlretrieve("http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_sa_debug.app.zip", "fp.app.zip")
|
if sys.version_info < (2, 6):
|
||||||
|
# Newer flash players won't run on Leopard
|
||||||
|
urllib.urlretrieve("http://download.macromedia.com/pub/flashplayer/updaters/10/flashplayer_10_sa_debug.app.zip", "fp.app.zip")
|
||||||
|
else:
|
||||||
|
urllib.urlretrieve("http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_sa_debug.app.zip", "fp.app.zip")
|
||||||
# Unzip the file. Apparently ditto is better for OSX apps than unzip.
|
# Unzip the file. Apparently ditto is better for OSX apps than unzip.
|
||||||
os.system('ditto -V -x -k --sequesterRsrc --rsrc fp.app.zip .')
|
os.system('ditto -V -x -k --sequesterRsrc --rsrc fp.app.zip .')
|
||||||
shutil.move('Flash Player Debugger.app', '/Applications')
|
shutil.move('Flash Player Debugger.app', '/Applications/Flash Player Debugger.app')
|
||||||
# Generally it is not recognized until it is opened
|
# Generally it is not recognized until it is opened
|
||||||
os.system('open -a "/Applications/Flash Player Debugger.app"')
|
os.system('open -a "/Applications/Flash Player Debugger.app"')
|
||||||
# Set Flash Player Debugger as the default app for .swf files
|
# Set Flash Player Debugger as the default app for .swf files
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ if sys.platform=="linux2":
|
||||||
from GUI import GL
|
from GUI import GL
|
||||||
try:
|
try:
|
||||||
from PIL import Image as PILImage
|
from PIL import Image as PILImage
|
||||||
except ImportError as err:
|
except ImportError:
|
||||||
import Image as PILImage
|
import Image as PILImage
|
||||||
from GUI.Geometry import offset_rect, rect_sized
|
from GUI.Geometry import offset_rect, rect_sized
|
||||||
|
|
||||||
|
|
@ -257,7 +257,7 @@ elif sys.platform=="win32":
|
||||||
from GUI import GL
|
from GUI import GL
|
||||||
try:
|
try:
|
||||||
from PIL import Image as PILImage
|
from PIL import Image as PILImage
|
||||||
except ImportError as err:
|
except ImportError:
|
||||||
import Image as PILImage
|
import Image as PILImage
|
||||||
media_path = ""
|
media_path = ""
|
||||||
SYSTEM="osx"
|
SYSTEM="osx"
|
||||||
|
|
@ -297,7 +297,7 @@ elif sys.platform=="darwin":
|
||||||
from GUI import GL
|
from GUI import GL
|
||||||
try:
|
try:
|
||||||
from PIL import Image as PILImage
|
from PIL import Image as PILImage
|
||||||
except ImportError as err:
|
except ImportError:
|
||||||
import Image as PILImage
|
import Image as PILImage
|
||||||
SYSTEM="osx"
|
SYSTEM="osx"
|
||||||
'''
|
'''
|
||||||
|
|
@ -2739,7 +2739,7 @@ class Group (object):
|
||||||
class TemporaryGroup(Group):
|
class TemporaryGroup(Group):
|
||||||
"""Created when selecting multiple items, for ease of use."""
|
"""Created when selecting multiple items, for ease of use."""
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(TemporaryGroup, self).__init__(*args, **kwargs)
|
(TemporaryGroup, self).__init__(*args, **kwargs)
|
||||||
# def draw(self, cr=None, transform=None, rect=None):
|
# def draw(self, cr=None, transform=None, rect=None):
|
||||||
# super(TemporaryGroup, self).draw(cr, transform, rect)
|
# super(TemporaryGroup, self).draw(cr, transform, rect)
|
||||||
# print self.x, self.activelayer.x
|
# print self.x, self.activelayer.x
|
||||||
|
|
|
||||||
Binary file not shown.
BIN
swfc/swfc_osx
BIN
swfc/swfc_osx
Binary file not shown.
Loading…
Reference in New Issue