Somebody must know this! [was plugin problems]

Olivier Dagenais olivierS.dagenaisP at canadaA.comM
Thu Oct 19 16:39:40 EDT 2000


The concept of a "plugin" seems to make more sense when source isn't
included or intepreted, hence the possible confusion.  In the world of
Python, you would probably want to make the dynamic execution of an
arbitrary file of code something invoked with the method 'execfile', instead
of what you're trying to do.

I would also recommend you create your GUI seperate from the rest of your
application, instead of welding them together and making it terribly
difficult to debug.

--
----------------------------------------------------------------------
Olivier A. Dagenais - Software Architect and Developer
"Someone called 'Type your name here' is impersonating me on the
internet and is posting exactly the same things I am posting!"


> I am sure someone surely knows the answer.
> Waiting patiently.......
> Thanks
> sreekant
>
>
>
>
> > Hi folks
> >
> > I am writing an application in python / Tkinter and Pmw. I am planning
> > to include plugin facility.
> > I am trying this way currently. It fails saying btnname attribute is
> not
> > available and also importing n says no module byname n, where I
> > planned to use n as a place holder to iterate over the .py plugin
> files
> > in ./plugins/ directory.
> >
> > Code follows.
> > ################################
> > Plugin loader in the application
> > #################################
> > self.pluginb=Pmw.ButtonBox(self.nb.pg_sys,orient='vertical')
> > for n in os.listdir('plugins'):
> >     import n
> >     self.pluginb.add(getattr(n,btnname),command=getattr(n,'mainrun'))
> >
> > ##########
> > example plugin
> > #####################
> > def mainrun():
> > print "hello world"
> >
> > btnname="HelloWorld"
> > ###############################
> > Any ideas and helpwould be greatly appreciated.
> >
> > Thanks
> > sreekant
> >
> > --
> > A man needs to sleep for 36 hours a day atleast.
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> --
> A man needs to sleep for 36 hours a day atleast.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.





More information about the Python-list mailing list