[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnucap-devel] Re: gnucap and python

From: al davis
Subject: Re: [Gnucap-devel] Re: gnucap and python
Date: Mon, 26 Mar 2007 11:35:06 -0400
User-agent: KMail/1.9.5

On Monday 26 March 2007 11:18, Cyril Giraudon wrote:
> I've downloaded the 21 02 2007 gnucap version and looked at
> the code (plugin foo devices, CMD class, "attach" and
> "detach" commands...)
> -
> Is it the latest version ? Is there a version with plugin
> commands ? Is there an example of a plugin for a command not
> for a device ?

This one has plugin commands, also plugin behavioral modeling 
> -
> About the python plugin, what would you like it to do ? Since
> it (the derived classes of CMD) can only call the "command"
> method, It can not add new capabilities ? Or will it be able
> to manipulate the sim instance, circuit instance... ?

Add commands?

What I was thinking of is a wrapper, like the Spice wrapper, in 
C++, that is an interface.  Once you have it, you can add 
whatever you want in python.

You would actually need one for each typeof plugin that you want 
to be able to write in python.
> -
> I 've seen commands (derived from CMD) never return an error
> indicator or throw an exception. That is to say that it's
> very difficult for the caller to know if nothing wrong
> happens. Errors are handled by the IO stream, the user is
> alerted but simply by a message on the screen. I think a
> wrapper can't detect easily the errors (add an action when an
> error occurs, change the font color, popup a window...).

They can throw exceptions.  gnucap uses old-style exceptions, 
because I never converted the code.  Call the function "error".  
If the first argument is bERROR, it goes back to prompt.

I am thinking of adding the ability for IO plugins, that would 
let you replace the plotter, the error handler, and so on.  
Would this help?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]