Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > creating addon system

Reply
Thread Tools

creating addon system

 
 
timo verbeek
Guest
Posts: n/a
 
      05-21-2010
What is the easiest way in python to create a addon system?
I found to easy ways:
* using a import system like this:
for striper in stripers:
if striper["enabled"]:
exec("from strip import %s as _x"%striper["striper"])
string = _x.start(string)
* using exec
for striper in stripers:
if striper["enabled"]:
use=open(stripper)
exec(use)

Do you now is the best way?
 
Reply With Quote
 
 
 
 
Krister Svanlund
Guest
Posts: n/a
 
      05-21-2010
On Fri, May 21, 2010 at 5:50 PM, timo verbeek <(E-Mail Removed)> wrote:
> What is the easiest way in python to create a addon system?
> I found to easy ways:
> * using a import system like this:
> * * * for striper in stripers:
> * * * *if striper["enabled"]:
> * * * * * *exec("from strip import %s as _x"%striper["striper"])
> * * * * * *string = _x.start(string)
> * using exec
> * * * for striper in stripers:
> * * * *if striper["enabled"]:
> * * * * * *use=open(stripper)
> * * * * * *exec(use)
>
> Do you now is the best way?
> --
> http://mail.python.org/mailman/listinfo/python-list
>


Check this one out: http://docs.python.org/library/funct...tml#__import__
 
Reply With Quote
 
 
 
 
Adam Tauno Williams
Guest
Posts: n/a
 
      05-21-2010
On Fri, 2010-05-21 at 08:50 -0700, timo verbeek wrote:
> What is the easiest way in python to create a addon system?
> I found to easy ways:
> * using a import system like this:
> for striper in stripers:
> if striper["enabled"]:
> exec("from strip import %s as _x"%striper["striper"])
> string = _x.start(string)


This is how I chose to do it. Just walking a list of bundles and
discover the available classes [as plugins].

<http://coils.hg.sourceforge.net/hgweb/coils/coils/file/b3538e9fafb9/src/coils/core/bundlemanager.py>

--
Adam Tauno Williams <(E-Mail Removed)> LPIC-1, Novell CLA
<http://www.whitemiceconsulting.com>
OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba

 
Reply With Quote
 
timo verbeek
Guest
Posts: n/a
 
      05-22-2010
Is there not an other way to create a fast addon system?
A module or something like that
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Explorer Addon kitkatrobins C++ 8 11-20-2007 05:49 PM
Addon / Utlity to Interrogate Cache Nho Whei Firefox 4 04-12-2007 08:39 AM
Addon etc for NT 4.0. workstation to easily login to Windows Servr 2003 Edward M Computer Support 2 09-19-2005 05:03 PM
Utilities/Addon for Creating Tables Amar Kapadia ASP .Net Web Controls 6 05-16-2005 10:21 AM
How do I remove the Theme Installer Addon David Tangye Firefox 0 01-02-2004 07:40 AM



Advertisments