Generating class definitions at runtime in memory from XSD or JSON

2012-02-16 Thread Stodge
Does anyone know of a library to generate class definitions in memory, at runtime, from XSD or JSON? I know about PyXB, generateDS and some others, but they all rely on generating python source files at the command line, and then using those to parse XML. Thanks -- http://mail.python.org/mailman/

Python DXF import library?

2010-04-20 Thread Stodge
Is anyone aware of a Python DXF import library? I think I remember seeing converters but so far I haven't found a library. I need to write a tool that reads DXFs so I'm not yet sure if a converter would be of any use. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Can I configure Markdown to not wrap my text in elements?

2009-12-22 Thread Stodge
I want to use Markdown to process some text before displaying it in a list. However, Markdown, by default, wraps the resulting text in elements, which screws up my list and displays the list item symbol and text on different lines. Can I stop Markdown from wrapping text in paragraphs elements? Sor

Re: Twisted Matrix and multicast broadcast

2008-10-09 Thread Stodge
On Oct 9, 9:33 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Thu, 9 Oct 2008 06:03:44 -0700 (PDT), Stodge <[EMAIL PROTECTED]> wrote: > > [snip] > >class MulticastServerUDP(DatagramProtocol): > >    def startProtocol(self): > >        print 'Sta

Twisted Matrix and multicast broadcast

2008-10-09 Thread Stodge
I'm trying to get a simple multicast application working using Twisted; so far I have: from twisted.internet.protocol import DatagramProtocol from twisted.internet import reactor from twisted.application.internet import MulticastServer class MulticastServerUDP(DatagramProtocol): def startProt

Boost Python DLL from Boost Pro is built incorrectly?

2008-08-20 Thread Stodge
I'm having issues with Boost Python, downloaded via http://www.boostpro.com. I *think* it's related to WinXP side by side assemblies. My application that uses Boost Python fails to start. I ran dependancy walker on the Boost Python DLL and I get the following: Error: The Side-by-Side configuratio

Re: Boost Python - C++ class' private static data blown away before accessing in Python?

2008-07-09 Thread Stodge
Oops - I didn't see my post so I thought something had gone wrong and reposted. Apologies for the multiple posts. On Jul 9, 11:57 am, Stodge <[EMAIL PROTECTED]> wrote: > Could it be a boundary problem? The static data is initialised by the > application. The problem arises when

Re: Boost Python - C++ class' private static data blown away before accessing in Python?

2008-07-09 Thread Stodge
Could it be a boundary problem? The static data is initialised by the application. The problem arises when the python module tries to access it. On Jul 5, 11:14 pm, Giuseppe Ottaviano <[EMAIL PROTECTED]> wrote: > > In Python, I retrive an Entity from the EntityList: > > > elist = EntityList() > >

Re: Boost Python - C++ class' private static data blown away before accessing in Python?

2008-07-09 Thread Stodge
I wonder if it's a DLL boundary problem. On Jul 5, 11:14 pm, Giuseppe Ottaviano <[EMAIL PROTECTED]> wrote: > > In Python, I retrive an Entity from the EntityList: > > > elist = EntityList() > > elist.append(Entity()) > > elist.append(Entity()) > > > entity = elist.get_at(0) > > > entity.foo() > >

Re: Boost Python - C++ class' private static data blown away before accessing in Python?

2008-07-09 Thread Stodge
Thanks. Maybe it's a DLL boundary issue? I'll look into this too. On Jul 5, 11:14 pm, Giuseppe Ottaviano <[EMAIL PROTECTED]> wrote: > > In Python, I retrive an Entity from the EntityList: > > > elist = EntityList() > > elist.append(Entity()) > > elist.append(Entity()) > > > entity = elist.get_at(0

Boost Python - C++ class' private static data blown away before accessing in Python?

2008-07-04 Thread Stodge
I've exposed a C++ class to Python using Boost Python. The class, let's say it's called Entity, contains private static data, which is an array of strings. Though I think it implements it using MFC's CPtrArray. I've also exposed a public function from Entity - let's say it's called foo. This funct

Boost::Python - Question about object ownership and lifetime

2008-05-02 Thread Stodge
Hi folks, new to Boost Python and struggling to build a prototype at work. I thought I'd start with a conceptual question to help clarify my understanding. I already have a basic prototype working nicely but I'm having a few issues, which I may post about later. A brief functional rundown of what

SWIG (Python) - "no constructor defined" for concrete class

2008-04-18 Thread Stodge
Yet another SWIG question (YASQ!). I'm having a problem with using an abstract base class. When generating the Python bindings, SWIG thinks that all the concrete classes that derive from this abstract class are abstract too and won't create the correct constructor. Abstract class: [source lang="

Re: Saving parameters between Python applications?

2007-10-13 Thread Stodge
os.getppid() isn't cross platform. I don't think it works on Windows. I think I'll just create a simple shell script (BAT or Bash) for each platform as needed. Thanks On Sep 20, 3:17 pm, David <[EMAIL PROTECTED]> wrote: > On 9/16/07, Stodge <[EMAIL PROTECTED]> wro

Re: Saving parameters between Python applications?

2007-09-19 Thread Stodge
Steve Holden <[EMAIL PROTECTED]> wrote: > Stodge wrote: > > os.path.expanduser isn't an option; I need each console/window to > > maintain different values which I wouldn't get from saving to a user's > > home directory. Unless I used a different file for each co

Re: Saving parameters between Python applications?

2007-09-18 Thread Stodge
os.path.expanduser isn't an option; I need each console/window to maintain different values which I wouldn't get from saving to a user's home directory. Unless I used a different file for each console/window but that just gets me into the same situation I'm already in. I think the only option is to

Re: Saving parameters between Python applications?

2007-09-17 Thread Stodge
You're probably right! Thanks all. :) On Sep 17, 10:15 am, Bruno Desthuilliers wrote: > Stodge a écrit : > > > > > I'm trying to do the following. I have a Python application that is > > run: > > > python app1.py --location=c:\test1 > > > Wh

Re: Saving parameters between Python applications?

2007-09-17 Thread Stodge
Good idea, but I can't guarantee that the two scripts will be run from the same directory - so where to store the pickle? On Sep 16, 5:25 pm, "Sebastian Bassi" <[EMAIL PROTECTED]> wrote: > On 9/16/07, Stodge <[EMAIL PROTECTED]> wrote: > > > python app1.py --

Saving parameters between Python applications?

2007-09-16 Thread Stodge
I'm trying to do the following. I have a Python application that is run: python app1.py --location=c:\test1 What I want to do is save the location parameter, so I can then do (in the same window): python app2.py And have app2.py automatically have access to the value of "location". Now, the di