Re: [Pythonmac-SIG] sad state of OS X Python testing...

2010-10-08 Thread Antoine Pitrou
On Tue, 5 Oct 2010 10:08:59 -0700
Stephen Hansen  wrote:
> On Sat, Oct 2, 2010 at 1:37 PM, "Martin v. Löwis" wrote:
> 
> > > I'm already running a Jython buildslave on an Intel Mac Pro which is
> > > pretty underused - I'd be happy to run a CPython one there too, if
> > > it'd be worthwhile.
> >
> > I think Bill was specifically after Snow Leopard - what system are you
> > using?
> >
> 
> I have a fairly recent MacPro on Snow Leopard, which I keep consistently up
> to date and its connected all the time. It has more capacity then I can
> really find use for.

Now that the buildbot is up, it is recommended that you try to
investigate the failures (and the test_ttk_guionly crash), and that you
create bugs reports on http://bugs.python.org for them.

Thank you!

Antoine.


___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


[Pythonmac-SIG] Problem bundling matplotlib with py2app: it looks for a font in /Library/Frameworks

2010-10-08 Thread Russell E. Owen
I have a Mac python application I bundle with py2app. It has 
successfully included matplotlib for several years. However recently I 
added strip charts to it and now I find that the Mac bundle is broken: 
when I run on a system that does not have matplotlib installed it dies 
with a traceback that ends with:

Traceback (most recent call last):
  File ".../python2.6/RO/Wdg/Toplevel.py", line 138, in __init__
  File ".../python2.6/TUI/Guide/GuideMonitor/GuideMonitorWindow.py", 
line 56, in __init__
  File ".../python2.6/RO/Wdg/StripChartWdg.py", line 161, in __init__
  File ".../python2.6/RO/Wdg/StripChartWdg.py", line 314, in 
_updateTimeAxis
  File ".../python2.6/matplotlib/backends/backend_tkagg.py", line 251, 
in draw
  File ".../python2.6/matplotlib/backends/backend_agg.py", line 394, in 
draw
  File ".../python2.6/matplotlib/artist.py", line 55, in draw_wrapper
  File ".../python2.6/matplotlib/figure.py", line 798, in draw
  File ".../python2.6/matplotlib/artist.py", line 55, in draw_wrapper
  File ".../python2.6/matplotlib/axes.py", line 1934, in draw
  File ".../python2.6/matplotlib/artist.py", line 55, in draw_wrapper
  File ".../python2.6/matplotlib/axis.py", line 1017, in draw
  File ".../python2.6/matplotlib/artist.py", line 55, in draw_wrapper
  File ".../python2.6/matplotlib/axis.py", line 234, in draw
  File ".../python2.6/matplotlib/artist.py", line 55, in draw_wrapper
  File ".../python2.6/matplotlib/text.py", line 524, in draw
  File ".../python2.6/matplotlib/text.py", line 298, in _get_layout
  File ".../python2.6/matplotlib/backends/backend_agg.py", line 180, in 
get_text_width_height_descent
  File ".../python2.6/matplotlib/backends/backend_agg.py", line 221, in 
_get_agg_font
RuntimeError: Could not open facefile 
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-pack
ages/matplotlib/mpl-data/fonts/ttf/Vera.ttf; Cannot_Open_Resource

where ... = 
/Users/rowen/TUI_1.8.2.1_Source/BuildForMac/dist/TUI.app/Contents/Resourc
es/lib

That font is available in the bundle itself:
ls -l 
TUI.app/Contents/Resources/lib/python2.6/matplotlib/mpl-data/fonts/ttf
total 4304
...
-rw-rw-r--  1 rowen  _rowen   65932 Jul  6 07:43 Vera.ttf
-rw-rw-r--  1 rowen  _rowen   63208 Jul  6 07:43 VeraBI.ttf
-rw-rw-r--  1 rowen  _rowen   58716 Jul  6 07:43 VeraBd.ttf
-rw-rw-r--  1 rowen  _rowen   63684 Jul  6 07:43 VeraIt.ttf
-rw-rw-r--  1 rowen  _rowen   55032 Jul  6 07:43 VeraMoBI.ttf
-rw-rw-r--  1 rowen  _rowen   49052 Jul  6 07:43 VeraMoBd.ttf
-rw-rw-r--  1 rowen  _rowen   54508 Jul  6 07:43 VeraMoIt.ttf
-rw-rw-r--  1 rowen  _rowen   49224 Jul  6 07:43 VeraMono.ttf
-rw-rw-r--  1 rowen  _rowen   60280 Jul  6 07:43 VeraSe.ttf
-rw-rw-r--  1 rowen  _rowen   58736 Jul  6 07:43 VeraSeBd.ttf
...

Does anyone have any ideas how to convince matplotlib to look for the 
font in the right place?

-- Russell

P.S. my configuration (though I've tried several others):
- Mac OS X 10.5 or 10.4
- python 2.6.6 (from python.org)
- matplotlib 1.0.0 (via the binary installer)
- py2app 0.5.2
- setuptools 0.6c11

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Sending stdout/err to a text console in a py2app App

2010-10-08 Thread Russell E. Owen
In article ,
 Gregory Jefferis  wrote:

> Hello,
> 
> I've made a simple python script to wrap a complex, long running shell
> script using easygui.  Then I've used py2app to make a Mac Application.  I'm
> happy except I would really like stdout/stderr from both my python wrapper
> script and the original shell script to be visible as the shell script runs.
> If I run the app from the Terminal that happens.  But if I double click,
> everything gets sent to the system logs (which can be inspected with
> Console.app).  
> 
> Is there anyway I can send anything useful to that empty console windows
> that appears when I start the py2app ?  Or a simple way to make a new
> console to which I can print.
> 
> Thank you very much for any help you can offer,
> 
> Greg.
> 
> Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
> [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
> MacOSX 10.5.8 intel

It would be so nice if py2applet had this built in. But alas it does not.

I assume this is an "applet" that processes files you drop on it (since 
anything else typically needs a GUI to be useful as a double-clickable 
application instead of a command-line tool).

So far the best I have come up with is RO.Wdg.DropletRunner, which is 
part of my RO package available at PyPI.

Features:
- It color codes the messages by source (stdout=black, stderr=red)
- Once the script has processed your initial batch of files you can drag 
new files onto it to process those

 However, it has a few rough edges:
- It requires a trivial script to run your script
- It wants a simple property list in your setup.py to specify what kind 
of files can be dropped on the applet
- It buffers the output more than I would like

Regards,

-- Russell

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG


Re: [Pythonmac-SIG] Problem bundling matplotlib with py2app: it looks for a font in /Library/Frameworks

2010-10-08 Thread Russell E. Owen
In article ,
 "Russell E. Owen"  wrote:

> I have a Mac python application I bundle with py2app. It has 
> successfully included matplotlib for several years. However recently I 
> added strip charts to it and now I find that the Mac bundle is broken: 
> when I run on a system that does not have matplotlib installed it dies 
> with a traceback...(could not find font file in /Library/Frameworks/Python...)

I found the problem, though not a robust solution. The problem is that 
matplotlib is using the font cache in ~/.matplotlib. Sometimes this gets 
out of date and then font files cannot be found. Unfortunately 
matplotlib does not realize the data is bogus and so crashes instead of 
rebuilding the cache files.

I have gotten two user reports of this problem. It also invalidates what 
I thought was a pretty solid test of whether my application is properly 
self-contained: move the Python, Tcl and Tk frameworks out of the way 
and then run my bundle. I have to also delete the matplotlib caches and 
then remember to delete them again after the test.

It would be really, really nice to have a standard way of forcing 
matplotlib to ignore cache files (neither read nor write them).

An adequate but less thorough solution is for matplotlib to test the 
font cache when it first loads it (e.g. by trying to find a font) and 
rebuild it if it doesn't work.

-- Russell

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG