On Fri, Jan 9, 2009 at 2:43 PM, Maxwell, Adam R <adam.maxw...@pnl.gov> wrote:
> On 01/09/09 12:34, "Michael McCracken" <michael.mccrac...@gmail.com> wrote:
>
>> On Fri, Jan 9, 2009 at 2:02 PM, Maxwell, Adam R <adam.maxw...@pnl.gov> wrote:
>
>>> Me too, but I've been hacking in python all morning and need a diversion :).
>>> Man, I wish I'd learned python a few years ago...that is a fun
>>> language/library combination.
>>
>> Agreed - python is good stuff. I have written some stuff in PyObjC,
>> and I like it much more than straight objC. It's really like the best
>> of both.
>
> Heh, I wrote a build script for my latest project [1] that bumps the version
> number, wraps it in a tarball, and creates a Sparkle appcast.  Using the
> familiar (to me) NSXMLDocument API via python was quicker than learning a
> different XML parser.

Having written a large chunk of code using libxml2 from python, I
think you made the right call.

Not that you should have used it, but if you're writing python build
scripts, have you seen Scons? http://scons.org/
I really like it, and briefly used it for some projects that required
mixing C and python when I wasn't using XCode. It shines in comparison
to make and autoconf. If you're just writing mac apps, it's less of a
win. (but still interesting)

Also, I see you do a little string template generation in that script.
Have you seen string.Template?
I use it with locals() sometimes for a nice hack:

def add_preduser_run(util_run_id, pred_run_id, completion_time, num_moves):
    sql = string.Template("""insert into preduser_runs values
                               ($util_run_id, $pred_run_id,
$completion_time, $num_moves)""")
    stmt = sql.substitute(locals()) # substitutes the variables in
scope that match the template
    # then do something with stmt...

Cheers,
-mike

> --
> Adam
>
> [1] http://code.google.com/p/mactlmgr/source/browse/trunk/build_tlu.py
>
>
> ------------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> _______________________________________________
> Bibdesk-develop mailing list
> Bibdesk-develop@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bibdesk-develop
>



-- 
Michael McCracken
UCSD CSE PhD Candidate
research: http://www.cse.ucsd.edu/~mmccrack/
misc: http://michael-mccracken.net/wp/

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Bibdesk-develop mailing list
Bibdesk-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to