dabo Commit
Revision 5141
Date: 2009-03-22 12:45:29 -0700 (Sun, 22 Mar 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5141
Changed:
A trunk/springboard/buildwin.bat
U trunk/springboard/main.py
U trunk/springboard/setup.py
A trunk/springboard/setup.py.win
U trunk/springboard/springboard.icns
U trunk/springboard/ui/springboard-code.py
Log:
Fixed the setup scripts so that it produces a Mac application using py2app.
Still cannot create a Windows exe using py2exe, though.
Created the .icns file for the Mac app.
Diff:
Added: trunk/springboard/buildwin.bat
===================================================================
--- trunk/springboard/buildwin.bat (rev 0)
+++ trunk/springboard/buildwin.bat 2009-03-22 19:45:29 UTC (rev 5141)
@@ -0,0 +1,2 @@
+python -OO setup.py py2exe --bundle 1
+
Property changes on: trunk/springboard/buildwin.bat
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/springboard/main.py
===================================================================
--- trunk/springboard/main.py 2009-03-19 21:26:01 UTC (rev 5140)
+++ trunk/springboard/main.py 2009-03-22 19:45:29 UTC (rev 5141)
@@ -1,13 +1,22 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import dabo
+import dabo.db
+import dabo.biz
+import dabo.lib
+import dabo.ui
dabo.ui.loadUI("wx")
-from dabo.lib import utils
+import dabo.lib.autosuper
+import dabo.lib.datanav
+import dabo.lib.datanav2
+import dabo.ui.dialogs
+
+
if __name__ == "__main__":
app = dabo.dApp()
app.BasePrefKey = "dabo.springboard"
app.MainFormClass = "springboard.cdxml"
- app.PreferenceManager.local_storage_dir =
utils.getUserAppDataDirectory()
+ app.PreferenceManager.local_storage_dir =
dabo.lib.utils.getUserAppDataDirectory()
app.start()
Modified: trunk/springboard/setup.py
===================================================================
--- trunk/springboard/setup.py 2009-03-19 21:26:01 UTC (rev 5140)
+++ trunk/springboard/setup.py 2009-03-22 19:45:29 UTC (rev 5141)
@@ -16,7 +16,7 @@
plat = sys.platform
if plat == "darwin":
# OS X
- OPTIONS = {"argv_emulation": True, "excludes": ["psycopg2", "MySQLdb",
"numpy"],
+ OPTIONS = {"argv_emulation": True, "excludes": ["psycopg2", "MySQLdb",
"numpy", "mx", "mx.DateTime"],
"iconfile": "springboard.icns"}
elif plat == "win32":
# Windows
@@ -73,9 +73,10 @@
data_files=DATA_FILES,
version = "1.0",
description = "Dabo Springboard",
- name = "dabo_springboard",
+ name = "Dabo Springboard",
# targets to build
app = ["main.py"],
+ #windows = ["main.py"],
#windows = [{"script": "tweezer.py", "icon_resources": [(0,
"tweezer.ico")]}],
#console = [{"script": "tweezer.py", "icon_resources": [(0,
"tweezer.ico")]}],
options={"py2app": OPTIONS,
Added: trunk/springboard/setup.py.win
===================================================================
--- trunk/springboard/setup.py.win (rev 0)
+++ trunk/springboard/setup.py.win 2009-03-22 19:45:29 UTC (rev 5141)
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+from distutils.core import setup
+import glob
+import py2exe
+import sys
+import os
+import dabo
+import dabo.icons
+
+DATA_FILES = []
+plat = sys.platform
+print "PLAT", plat
+if plat == "darwin":
+ # OS X
+ OPTIONS = {"argv_emulation": True, "excludes": ["psycopg2", "MySQLdb",
"numpy"],
+ "iconfile": "springboard.icns"}
+elif plat == "win32":
+ # Windows
+ import py2exe
+ OPTIONS = {"excludes": ["psycopg2", "MySQLdb", "numpy", "kinterbasdb"]}
+
+
+daboDir = os.path.split(dabo.__file__)[0]
+
+# Find the location of the dabo icons:
+iconDir = os.path.split(dabo.icons.__file__)[0]
+iconSubDirs = []
+def getIconSubDir(arg, dirname, fnames):
+ if os.path.split(dirname)[1] in (".svn", "cards"):
+ return
+ icons = glob.glob(os.path.join(dirname, "*.png"))
+ if icons:
+ subdir = (os.path.join("resources", dirname[len(arg)+1:]),
icons)
+ iconSubDirs.append(subdir)
+os.path.walk(iconDir, getIconSubDir, iconDir)
+DATA_FILES.extend(iconSubDirs)
+
+# locales:
+localeDir = os.path.join(daboDir, "locale")
+locales = []
+def getLocales(arg, dirname, fnames):
+ if os.path.split(dirname)[1] in (".svn", ):
+ return
+ mo_files = tuple(glob.glob(os.path.join(dirname, "*.mo")))
+ if mo_files:
+ subdir = os.path.join("locale", dirname[len(arg)+1:])
+ locales.append((subdir, mo_files))
+os.path.walk(localeDir, getLocales, localeDir)
+DATA_FILES.extend(locales)
+
+
+# Application files. Include all but .pyc
+appDir = os.getcwd()
+appFiles = []
+def getAppFiles(arg, dirname, fnames):
+ if os.path.split(dirname)[1] in (".svn", "supplemental", "test"):
+ return
+ currnames = glob.glob(os.path.join(dirname, "*"))
+ filtered = tuple([nm for nm in currnames
+ if not nm.endswith(".pyc")
+ and not os.path.isdir(nm)])
+ if filtered:
+ subdir = dirname[len(arg)+1:]
+ appFiles.append((subdir, filtered))
+os.path.walk(appDir, getAppFiles, appDir)
+DATA_FILES.extend(appFiles)
+
+setup(
+ # 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.
+ data_files=DATA_FILES,
+ version = "1.0",
+ description = "Dabo Springboard",
+ name = "Dabo Springboard",
+ # targets to build
+ windows = ["main.py"],
+ #console = ["main.py"],
+ options={"py2app": OPTIONS,
+ "py2exe": OPTIONS},
+ )
+
+# To build, run:
+#
+# python setup.py py2exe --bundle 1
Property changes on: trunk/springboard/setup.py.win
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/springboard/springboard.icns
===================================================================
(Binary files differ)
Modified: trunk/springboard/ui/springboard-code.py
===================================================================
--- trunk/springboard/ui/springboard-code.py 2009-03-19 21:26:01 UTC (rev
5140)
+++ trunk/springboard/ui/springboard-code.py 2009-03-22 19:45:29 UTC (rev
5141)
@@ -7,6 +7,7 @@
import os
import time
import urlparse
+import re
import dabo
from dabo.lib.RemoteConnector import RemoteConnector
from dabo.dLocalize import _
@@ -46,9 +47,12 @@
## *!* ## Dabo Code ID: dForm-top
def _getAddress(self):
try:
- return self.txtAddress.Value
+ addr = self.txtAddress.Value
except AttributeError:
return None
+ if not re.match("https?://.*", addr):
+ addr = "http://%s" % addr
+ return addr
def _runApp(self, path):
@@ -139,6 +143,10 @@
def connectToServer(self, key=None):
addr = self.Address
+ if not addr:
+ dabo.ui.stop("Please enter the address of the server.")
+ self.txtAddress.setFocus()
+ return
try:
result = self._proxy.launch(url=addr)
except StandardError, e:
_______________________________________________
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/[email protected]