daborun Commit
Revision 26
Date: 2007-11-13 10:11:12 -0800 (Tue, 13 Nov 2007)
Author: Ed
Trac: http://svn.dabodev.com/trac/daborun/changeset/26
Changed:
U trunk/README.txt
U trunk/cx_Freeze/ModuleFinder.py
U trunk/cx_Freeze/initscripts/ConsoleSetLibPath.py
U trunk/daborun.iss
U trunk/daborun.py
U trunk/makedist.py
U trunk/pathToDabo.py
U trunk/setup.py
U trunk/version.py
Log:
I've made a bunch of changes in the latest release of the runtime engine, so
it's about time that I committed them!
Diff:
Modified: trunk/README.txt
===================================================================
--- trunk/README.txt 2007-02-06 03:34:15 UTC (rev 25)
+++ trunk/README.txt 2007-11-13 18:11:12 UTC (rev 26)
@@ -15,7 +15,9 @@
and the engine will run the specified script. Or, if you don't like the
command-line approach, simply double-click either the shortcut installed on
your desktop, or the daborun.exe file itself. You will then be presented with a
file selection dialog, where you can pick the file you want to run.
+If you like using the command prompt, you can add the Dabo Runtime directory
to your system's PATH environmental variable. Then you can simply type:
"daborun myscript.py" in order to run the 'myscript.py' file.
+
There's a whole bunch of .py files! Which ones should I run?
----------------------------------------------------------
In order to make it easy to try Dabo, there are several shortcuts set up,
located inside the 'Common' directory off of the directory in which you
installed the engine. You can just double-click them to run. Here are the
various shortcuts and what they do:
@@ -24,30 +26,17 @@
----------------
DaboDemo - An example of some of the UI controls and how to work with them.
The code for each demo is visible, and you can modify it and run that modified
code without harming the original. This is a great way to learn about
programming the Dabo UI.
-Bubblet - a fun little game where you get to pop lots of bubbles that
demonstrates some of the non-database capabilities of Dabo.
-Montana - a simple solitaire game that some have found to be very addictive!
-
-SimpleFormWithBizobj - this is the basic application demo. If you have
internet connectivity, it will let you query, edit and update a demo database
located on the dabodev.com servers. You can create your own apps like this in
under a minute using the Dabo AppWizard.
-
-sizerTutorial - a simple demo that helps those who are new to the concept of
using sizers to lay out a form figure out how the various settings for a sizer
affect the size and position of the objects within the sizer.
-
-
Development Tools:
-------------------
AppWizard - as mentioned above, this is a wizard that guides you through the
creation of a complete application that can connect to one of many backend
databases. The runtime engine only supports MySQL and Firebird databases
currently.
-ClassDesigner - this tool allows you to visually lay out your UI classes, and
also add code that will fire when the appropriate events occur. You can create
classes that can be re-used inside of other classes, and save the whole thing
as a runnable application.
+Class Designer - this tool allows you to visually lay out your UI classes, and
also add code that will fire when the appropriate events occur. You can create
classes that can be re-used inside of other classes, and save the whole thing
as a runnable application.
-ReportDesigner - Most database applications also need to be able to generate
reports on the data, and this tool allows you to visually lay out and control
the apppearance of your reports.
+Report Designer - Most database applications also need to be able to generate
reports on the data, and this tool allows you to visually lay out and control
the apppearance of your reports.
-ConnectionEditor - Dabo can store information for connecting to a database in
a small XML file. This tool allows you to enter the information, test the
connections, and save the info in that XML format.
+Connection Editor - Dabo can store information for connecting to a database in
a small XML file. This tool allows you to enter the information, test the
connections, and save the info in that XML format.
-Editor - A powerful Python text editor written in Dabo. It features code
completion, syntax coloring, and lots of other cool stuff.
+Text Editor - A powerful Python text editor written in Dabo. It features code
completion, syntax coloring, and lots of other cool stuff.
-PrefEditor - a handy tool for viewing, editing and/or deleting any saved
preferences on your system.
-
-
-
-
-
+Preference Editor - a handy tool for viewing, editing and/or deleting any
saved preferences on your system. Still a work in progress, so some visual
elements may not work consistently.
Modified: trunk/cx_Freeze/ModuleFinder.py
===================================================================
--- trunk/cx_Freeze/ModuleFinder.py 2007-02-06 03:34:15 UTC (rev 25)
+++ trunk/cx_Freeze/ModuleFinder.py 2007-11-13 18:11:12 UTC (rev 26)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
"""Wrapper for the standard library Python module modulefinder which manages
a few of the things that the standard module does not manage."""
Modified: trunk/cx_Freeze/initscripts/ConsoleSetLibPath.py
===================================================================
--- trunk/cx_Freeze/initscripts/ConsoleSetLibPath.py 2007-02-06 03:34:15 UTC
(rev 25)
+++ trunk/cx_Freeze/initscripts/ConsoleSetLibPath.py 2007-11-13 18:11:12 UTC
(rev 26)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# ConsoleSetLibPath.py
# Initialization script for cx_Freeze which manipulates the path so that the
Modified: trunk/daborun.iss
===================================================================
--- trunk/daborun.iss 2007-02-06 03:34:15 UTC (rev 25)
+++ trunk/daborun.iss 2007-11-13 18:11:12 UTC (rev 26)
@@ -3,7 +3,7 @@
[Setup]
AppName=Dabo Runtime Engine
-AppVerName=DaboRun 0.7.2
+AppVerName=DaboRun 0.8.2 - rev 20071113
AppPublisher=Ed Leafe
AppPublisherURL=http://dabodev.com
AppSupportURL=http://dabodev.com
@@ -13,8 +13,9 @@
AllowNoIcons=yes
Compression=lzma
SolidCompression=yes
-OutputBaseFilename=DaboRuntimeSetup
-;OutputBaseFilename=DaboRuntimeSetupConsole
+ChangesAssociations=yes
+;OutputBaseFilename=DaboRuntimeSetup
+OutputBaseFilename=DaboRuntimeSetupConsole
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription:
{cm:AdditionalIcons}
@@ -30,86 +31,43 @@
Name: {app}\ide\*; Type: filesandordirs
[Files]
-Source: C:\projects\daborun\dist\daborun.exe; DestDir: {app}; Flags:
ignoreversion
-Source: C:\projects\daborun\dist\*; Excludes: Output\*, *.iss; DestDir: {app};
Flags: ignoreversion recursesubdirs
+Source: P:\daborun\trunk\dist\daborun.exe; DestDir: {app}; Flags: ignoreversion
+Source: P:\daborun\trunk\dist\*; Excludes: Output\*, *.iss; DestDir: {app};
Flags: ignoreversion recursesubdirs
Source: C:\cleanprojects\dabo\*; DestDir: {app}\dabo; Flags: ignoreversion
recursesubdirs
-;Source: "C:\cleanprojects\dabo\icons\*.png"; DestDir: "{app}\dabo"; Flags:
ignoreversion recursesubdirs
Source: C:\cleanprojects\demo\*; DestDir: {app}\demo; Flags: ignoreversion
recursesubdirs; AfterInstall: LinkDemo
Source: C:\cleanprojects\ide\*; DestDir: {app}\ide; Flags: ignoreversion
recursesubdirs; AfterInstall: LinkIDE
-Source: C:\Python24\msvcr71.dll; DestDir: {app}; Flags: ignoreversion
+Source: C:\Python25\msvcr71.dll; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: README.txt; DestDir: {app}; Flags: isreadme
+
[Icons]
-Name: {group}\Dabo Runtime Engine; Filename: {app}\daborun.exe; IconFilename:
{app}\dabo\icons\daboIcon.ico; Tasks:
+Name: {group}\Dabo Runtime Engine; Filename: {app}\daborun.exe; IconFilename:
{app}\dabo\icons\daboIcon.ico; WorkingDir: "{app}"
Name: {group}\{cm:UninstallProgram,Dabo Runtime Engine}; Filename:
{uninstallexe}
-Name: {userdesktop}\Dabo Runtime Engine; Filename: {app}\daborun.exe; Tasks:
desktopicon
-Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Dabo Runtime
Engine; Filename: {app}\daborun.exe; Tasks: quicklaunchicon
+Name: {userdesktop}\Dabo Runtime Engine; Filename: {app}\daborun.exe;
IconFilename: {app}\dabo\icons\daboIcon.ico; WorkingDir: "{app}"; Tasks:
desktopicon
+Name: {userdesktop}\Dabo Shortcuts; Filename: {app}\Common; WorkingDir:
"{app}"; Tasks: desktopicon
+Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\Dabo Runtime
Engine; Filename: {app}\daborun.exe; IconFilename:
{app}\dabo\icons\daboIcon.ico; WorkingDir: "{app}"; Tasks: quicklaunchicon
-;;;; PrefEditors isn't working just right yet, so don't add the link
-; CreateShellLink(
-; ExpandConstant('{app}\Common\PrefEditor.lnk'),
-; 'Shortcut to the Preference Editor program',
-; ExpandConstant('{app}\daborun.exe'),
-; ExpandConstant('"{app}\ide\PrefEditor.py"'),
-; ExpandConstant('{app}\ide'),
-; '',
-; 0,
-; SW_SHOWNORMAL) ;
+;[Registry]
+;Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\App Paths";
ValueType: string; ValueName: ""; ValueData: "{app}\daborun.exe"; Flags:
uninsdeletekey
+;Root: HKCR; Subkey: "daboruntime"; ValueType: string; ValueName: "";
ValueData: "Dabo Runtime Engine"; Flags: uninsdeletekey
+;Root: HKCR; Subkey: "daboruntime\DefaultIcon"; ValueType: string; ValueName:
""; ValueData: "{app}\daborun.exe,0"
+;Root: HKCR; Subkey: "daboruntime\shell\open\command"; ValueType: string;
ValueName: ""; ValueData: """{app}\daborun.exe"" ""%1"""
+
[Code]
procedure LinkDemo();
begin
CreateShellLink(
- ExpandConstant('{app}\Common\SimpleFormWithBizobj.lnk'),
- 'Shortcut to the SimpleFormWithBizobj demo',
+ ExpandConstant('{app}\Common\DaboDemo.lnk'),
+ 'Shortcut to the DaboDemo application',
ExpandConstant('{app}\daborun.exe'),
- ExpandConstant('"{app}\demo\SimpleFormWithBizobj.py"'),
+ ExpandConstant('"{app}\demo\DaboDemo.py"'),
ExpandConstant('{app}\demo'),
'',
0,
SW_SHOWNORMAL) ;
- CreateShellLink(
- ExpandConstant('{app}\Common\Dabo Demo.lnk'),
- 'Shortcut to the DaboDemo program',
- ExpandConstant('{app}\daborun.exe'),
- ExpandConstant('"{app}\demo\DaboDemo\DaboDemo.py"'),
- ExpandConstant('{app}\demo\DaboDemo'),
- '',
- 0,
- SW_SHOWNORMAL) ;
-
- CreateShellLink(
- ExpandConstant('{app}\Common\Bubblet.lnk'),
- 'Shortcut to the Bubblet game',
- ExpandConstant('{app}\daborun.exe'),
- ExpandConstant('"{app}\demo\games\bubblet\main.py"'),
- ExpandConstant('{app}\demo\games\bubblet'),
- '',
- 0,
- SW_SHOWNORMAL) ;
-
- CreateShellLink(
- ExpandConstant('{app}\Common\Montana.lnk'),
- 'Shortcut to the Montana solitaire game',
- ExpandConstant('{app}\daborun.exe'),
- ExpandConstant('"{app}\demo\games\montana.py"'),
- ExpandConstant('{app}\demo\games'),
- '',
- 0,
- SW_SHOWNORMAL) ;
-
- CreateShellLink(
- ExpandConstant('{app}\Common\Sizer Tutorial.lnk'),
- 'Shortcut to the sizer tutorial',
- ExpandConstant('{app}\daborun.exe'),
- ExpandConstant('"{app}\demo\tutorial\sizerExample.py"'),
- ExpandConstant('{app}\demo\tutorial'),
- '',
- 0,
- SW_SHOWNORMAL) ;
-
end ;
procedure LinkIDE();
@@ -164,6 +122,24 @@
0,
SW_SHOWNORMAL) ;
- end ;
-
+ CreateShellLink(
+ ExpandConstant('{app}\Common\Preference Editor.lnk'),
+ 'Shortcut to the Preference Editor program',
+ ExpandConstant('{app}\daborun.exe'),
+ ExpandConstant('"{app}\ide\PrefEditor.py"'),
+ ExpandConstant('{app}\ide'),
+ '',
+ 0,
+ SW_SHOWNORMAL) ;
+end ;
+
+function MessageBox(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal):
+ Integer; external '[EMAIL PROTECTED] stdcall';
+
+begin
+ if MessageBox(-1, '', '', -1) = 0 then
+ MsgBox('what the hell', mbError, mb_Ok);
+end .
+
+
Modified: trunk/daborun.py
===================================================================
--- trunk/daborun.py 2007-02-06 03:34:15 UTC (rev 25)
+++ trunk/daborun.py 2007-11-13 18:11:12 UTC (rev 26)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
import sys
import os
import time
@@ -82,7 +83,7 @@
import winpdb
import MySQLdb
- import pysqlite2
+ import sqlite3
import kinterbasdb
# For PIL compatibility
@@ -150,6 +151,8 @@
# be searched for, and it will become
Application.HomeDirectory.
pth = os.path.split(self.prg)[0]
if pth:
+ # Make it absolute
+ pth = os.path.abspath(pth)
sys._daboRunHomeDir = pth
# This prg path may have been appended already,
but we need
@@ -175,68 +178,70 @@
def run(self):
+ if not self.prg:
+ app = wx.PySimpleApp()
+ prmpt = "Please select the Python file to run..."
+ wildcard = "Python Files (*.py)|*.py|" \
+ "Compiled Python (*.pyc)|*.pyc|" \
+ "All files (*.*)|*.*"
+ openDlg = wx.FileDialog(None, prmpt, wildcard=wildcard,
+ defaultDir=os.getcwd(), style=wx.OPEN )
#| wx.HIDE_READONLY)
+ res = openDlg.ShowModal()
+ app.Destroy()
+ pth = openDlg.GetPath()
+
+ debugout("SELECTION", pth)
+ debugout("DLG RESULT", res, res == wx.ID_OK)
+
+ openDlg.Destroy()
+ if res == wx.ID_OK:
+ self.prg = pth
+
if self.prg:
impt = self.prg
- isFile = (impt[-3:] == ".py")
+ isFile = (impt.endswith(".py"))
if isFile:
impt = self.prg[:-3]
-
- debugout("self.prg:", self.prg, impt)
+
+ debugout("self.prg:", self.prg, "impt", impt)
debugout("self.module:", self.module)
+
+ if os.path.exists("C:\DABO-DEBUG.TXT"):
+ import pdb
+ pdb.set_trace()
- if not self.module:
+ hasRun = False
+ if self.module:
+ debugout("EXEC:", impt + "." + self.module +
"()")
+ try:
+ exec(impt + "." + self.module + "()")
+ hasRun = True
+ except StandardError, e:
+ print "EXEC ERROR:", e
+
+ if not hasRun:
if isFile:
pthDir, prg = os.path.split(self.prg)
if not pthDir:
pthDir = os.getcwd()
- debugout("PTHDIR", pthDir)
+ debugout("PTHDIR", pthDir, "PRG", prg)
if pthDir not in sys.path:
sys.path.insert(0, pthDir)
debugout("BEFORE EXEC ISFILE:
INSERTING %s INTO PATH"% pthDir)
+ debugout("SYSPATH", sys.path)
os.chdir(pthDir)
try:
+ debugout("ABOUT TO EXECFILE:",
prg)
+ debugout("CURDIR:", os.getcwd())
execfile(prg, {"__name__":
"__main__"} )
except StandardError, e:
debugout("EXECFILE ERROR", e)
else:
# File should run directly when imported
exec("import " + impt)
- else:
- debugout("EXEC:", impt + "." + self.module +
"()")
- exec(impt + "." + self.module + "()")
- else:
- app = wx.PySimpleApp()
- prmpt = "Please select the Python file to run..."
- wildcard = "Python Files (*.py)|*.py|" \
- "Compiled Python (*.pyc)|*.pyc|" \
- "All files (*.*)|*.*"
- openDlg = wx.FileDialog(None, prmpt, wildcard=wildcard,
- defaultDir=os.getcwd(), style=wx.OPEN )
#| wx.HIDE_READONLY)
- res = openDlg.ShowModal()
- app.Destroy()
- pth = openDlg.GetPath()
- debugout("SELECTION", pth)
-
- openDlg.Destroy()
- if res == wx.ID_OK:
- if pth:
- pthDir, prg = os.path.split(self.prg)
- if not pthDir:
- pthDir = os.getcwd()
- debugout("PTHDIR", pthDir)
- if pthDir not in sys.path:
- sys.path.insert(0, pthDir)
- debugout("BEFORE EXEC:
APPENDING %s to PATH"% pthDir)
- os.chdir(pthDir)
-
- debugout("")
- debugout("PATH BEFORE EXECUTION", sys.path)
- execfile(pth, {"__name__": "__main__"} )
-
-
if __name__ == "__main__":
dEngine = DaboRuntimeEngine()
dEngine.run()
Modified: trunk/makedist.py
===================================================================
--- trunk/makedist.py 2007-02-06 03:34:15 UTC (rev 25)
+++ trunk/makedist.py 2007-11-13 18:11:12 UTC (rev 26)
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
### dotamatic
###
### Copyright (C) 2003-2004 Roger Binns <[EMAIL PROTECTED]>
Modified: trunk/pathToDabo.py
===================================================================
--- trunk/pathToDabo.py 2007-02-06 03:34:15 UTC (rev 25)
+++ trunk/pathToDabo.py 2007-11-13 18:11:12 UTC (rev 26)
@@ -1,2 +1,3 @@
+# -*- coding: utf-8 -*-
def getDaboPath():
- return "/home/ed/pack"
\ No newline at end of file
+ return "/home/ed/pack"
Modified: trunk/setup.py
===================================================================
--- trunk/setup.py 2007-02-06 03:34:15 UTC (rev 25)
+++ trunk/setup.py 2007-11-13 18:11:12 UTC (rev 26)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
from distutils.core import setup
import glob
import py2exe
@@ -6,25 +7,28 @@
# The first three parameters are not required, if at least a
# 'version' is given, then a versioninfo resource is built from
# them and added to the executables.
- version = "0.7.2",
+ version = "0.8.2",
description = "Dabo Runtime Engine",
name = "daborun",
# targets to build
-# console = ["daborun.py"],
- windows = ["daborun.py"],
+ console = ["daborun.py"],
+# windows = ["daborun.py"],
#exclude the actual framework
options = { "py2exe":
- {"includes" : ["ConfigParser", "threading",
"mx.DateTime", "platform",
- "winpdb", "pydoc", "PIL"],
+ {"includes" : ["code", "compiler", "ConfigParser",
"copy", "cStringIO",
+ "datetime", "encodings", "imghdr", "inspect",
"keyword", "locale",
+ "math", "mx.DateTime", "operator", "PIL",
"platform", "pydoc",
+ "random", "sqlite3", "string", "tempfile",
"test", "threading", "time",
+ "traceback", "types", "unittest", "urllib",
"urllib2", "urlparse", "warnings"],
"excludes" : ["dabo", "dabo.db", "dabo.biz",
"dabo.lib", "dabo.ui",
"dabo.common", "dabo.icons", "dabo.ui.uiwx",
"Tkconstants", "Tkinter", "tcl",
"_imagingtk", "PIL._imagingtk", "ImageTk",
"PIL.ImageTk", "FixTk"],
- "packages" : ["MySQLdb", "encodings", "kinterbasdb",
"pysqlite2",
- "psycopg2", "wx.gizmos", "wx.lib.calendar",
"wx.lib.foldpanelbar",
- "wx.lib.hyperlink", "wx.lib.masked",
"wx.lib.buttons",
- "reportlab"]} },
+ "packages" : ["MySQLdb", "kinterbasdb", "psycopg2",
"reportlab",
+ "wx.aui", "wx.calendar", "wx.gizmos",
"wx.grid", "wx.html", "wx.lib.buttons",
+ "wx.lib.calendar", "wx.lib.foldpanelbar",
"wx.lib.hyperlink", "wx.lib.masked",
+ "wx.lib.mixins.listctrl", "wx.lib.pdfwin",
"wx.lib.plot", "wx.py", "wx.stc"]} },
)
# To build, run:
#
-# python setup.py py2exe --bundle 1
\ No newline at end of file
+# python setup.py py2exe --bundle 1
Modified: trunk/version.py
===================================================================
--- trunk/version.py 2007-02-06 03:34:15 UTC (rev 25)
+++ trunk/version.py 2007-11-13 18:11:12 UTC (rev 26)
@@ -1,7 +1,8 @@
+# -*- coding: utf-8 -*-
name = "Dabo Runtime Engine"
description = "Self-contained engine for running Dabo apps"
-copyright = "(c)2004-6 Edward Leafe"
-version = "0.7"
-release = "2006-11-21"
+copyright = "(c)2004-7 Edward Leafe"
+version = "0.8.2"
+release = "2007-11-13"
url = "http://dabodev.com"
testver = True
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]