Re: [dabo-users] Making an OS X App

2008-07-01 Thread Henning Hraban Ramm
Here's a sample setup.py from one of my projects. Never tested the windows part:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

Setup settings for TerraTool

Usage (MacOS X):
python setup.py py2app

Usage (Windows):
python setup.py py2exe


import ez_setup
ez_setup.use_setuptools()

import os, sys
import dabo #, dabo.icons
from setuptools import setup

# locales:
daboDir = os.path.split(dabo.__file__)[0]
localeDir = os.path.join(daboDir, 'locale')
locales = [
('lib/python2.5/dabo.locale', ( os.path.join(localeDir,
'dabo.pot'), ) ),
('lib/python2.5/dabo.locale/de/LC_MESSAGES',
(os.path.join(localeDir, 'de', 'LC_MESSAGES', 'dabo.mo'),)),
('lib/python2.5/dabo.locale/en/LC_MESSAGES',
(os.path.join(localeDir, 'en', 'LC_MESSAGES', 'dabo.mo'),)),
('locale/de/LC_MESSAGES/terratool.mo'),
('locale/en/LC_MESSAGES/terratool.mo'),
]

mainscript = 'terratool.py'
NAME = 'TerraTool'
VERSION = '0.1.0'
APP = [mainscript]
DATA_FILES = locales
APP_OPTIONS = {
   'argv_emulation': True,
   'includes' : ['wx', 'wx.gizmos', 'wx.lib.calendar',
'dabo', 'Growl'], #, 'wx.lib.masked', 'dabo.icons',
   'excludes' : ['kinterbasdb', 'psycopg2', 'MySQLdb', 'numpy'],
   'iconfile' : 'appIcon.icns',
}
# includes must not reside in zipped eggs, i.e. install via
easy_install -Z foo

EXE_OPTIONS = {
}

plist = dict(
  CFBundleName= NAME,
  CFBundleShortVersionString= VERSION,
  CFBundleGetInfoString= '%s
%s' % (NAME, VERSION),
  CFBundleExecutable= NAME,
  CFBundleIdentifier= '
net.fiee.terratool',
  )


manifest = 
?xml version=1.0 encoding=UTF-8 standalone=yes?
assembly xmlns=urn:schemas-microsoft-com:asm.v1
manifestVersion=1.0
assemblyIdentity
version=0.64.1.0
processorArchitecture=x86
name=Controls
type=win32
/
descriptionTerraTool/description
dependency
dependentAssembly
assemblyIdentity
type=win32
name=Microsoft.Windows.Common-Controls
version=6.0.0.0
processorArchitecture=X86
publicKeyToken=6595b64144ccf1df
language=*
/
/dependentAssembly
/dependency
/assembly


if sys.platform == 'darwin':
APP_OPTIONS['plist'] = plist
extra_options = dict(
# Cross-platform applications generally expect sys.argv to
# be used for opening files.
setup_requires=['py2app'],
app=APP,
options={'py2app': APP_OPTIONS},
   )
elif sys.platform == 'win32':

windows = [
{
script: mainscript,
icon_resources: [(1, yourapplication.ico)],
other_resources: [(24,1,manifest)]
}
],
  data_files=[yourapplication.ico]


extra_options = dict(
 script = mainscript,
 setup_requires=['py2exe'],
 app=APP,
 )
else:
 extra_options = dict(
 # Normally unix-like platforms will use setup.py install
 # and install the main script as such
 scripts=APP,
 )


setup(
name=NAME,
data_files=DATA_FILES,
**extra_options
)


Greetlings, Hraban


___
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]


[dabo-users] Making an OS X App

2008-06-28 Thread John Velman
I've gotten the convert python scripts... from
Undefined.org/python/py2app.html, and also the older one from
svn.pythonmac.org...

I've also looked at the dabo/demo setup.py, but it seems to be for windoz.

I'd like to make a very simple app, (followed by some increasingly complex
ones, leading up to the real thing), so I know I'm on the right track
before I invest too much time on the wrong track.

New to Mac and to dabo. Never did a py2app before.

OK, for my first app, I'd like to make a version of th Hello_msgBox
from the tutorial of that name into a stand alone app building on intel Leopard
10.5.3, and running on Tiger ppc.

So far, I haven't the faintest idea how to write a setup.py for the dabo
framework that even builds a working app on leopard.

I'm probably dumber than a rock, but the Convert python scripts...
directions are cryptic, as far as I'm concerned.  Can someone point me to
an example for MAC OS X for  dabo, or a less cryptic explanation?

(My googling with a variety of sets of keywords mostly results in lists of
questions posted to the wxPython list :-))

Thanks,

John V.


___
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]


Re: [dabo-users] Making an OS X App

2008-06-28 Thread John Velman
THanks!,  Looks like tomorrow before I try it now, but I'll be in touch.

John V.

On Sat, Jun 28, 2008 at 06:50:26PM -0500, Ed Leafe wrote:
 On Jun 28, 2008, at 4:56 PM, John Velman wrote:
 
  New to Mac and to dabo. Never did a py2app before.
 
  OK, for my first app, I'd like to make a version of th Hello_msgBox
  from the tutorial of that name into a stand alone app building on  
  intel Leopard
  10.5.3, and running on Tiger ppc.
 
  So far, I haven't the faintest idea how to write a setup.py for the  
  dabo
  framework that even builds a working app on leopard.
 
 
   Coincidence? I spent much of the day trying to get one of my Dabo  
 apps built using py2app, but without success. My problem is that  
 building the app leaves out the dabo/locale/* files, which then throws  
 an error. But it sounds like you're not even that far yet.
 
   To create your setup.py, go to the directory containing the main  
 script of your app, and type:
 
 py2applet --make-setup MyMainScript.py
 
 That will create a basic setup.py. You can try building from that by  
 running:
 
 python setup.py py2app
 
 This will create two subdirectories off of your app's main dir:  
 'build' (containing intermediate stuff), and 'dist' (containing your  
 Mac application). You can then try running the app from there, or  
 copying it to a different machine and running it on the non- 
 development machine. This is the part that I'm stuck at; why don't you  
 try this and let me know how it works for you.
 
 -- Ed Leafe
 
 
 
 
 
[excessive quoting removed by server]

___
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]