Somebody must know this! [was plugin problems]

Sindh skodela at my-deja.com
Thu Oct 19 16:04:49 EDT 2000


I am sure someone surely knows the answer.
Waiting patiently.......
Thanks
sreekant




In article <8sfp1f$35p$1 at nnrp1.deja.com>,
  Sindh <skodela at my-deja.com> wrote:
> 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