creating addon system

Discussion in 'Python' started by timo verbeek, May 21, 2010.

  1. timo verbeek

    timo verbeek Guest

    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?
     
    timo verbeek, May 21, 2010
    #1
    1. Advertising

  2. On Fri, May 21, 2010 at 5:50 PM, 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)
    > * 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/functions.html#__import__
     
    Krister Svanlund, May 21, 2010
    #2
    1. Advertising

  3. 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 <> LPIC-1, Novell CLA
    <http://www.whitemiceconsulting.com>
    OpenGroupware, Cyrus IMAPd, Postfix, OpenLDAP, Samba
     
    Adam Tauno Williams, May 21, 2010
    #3
  4. timo verbeek

    timo verbeek Guest

    Is there not an other way to create a fast addon system?
    A module or something like that
     
    timo verbeek, May 22, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kitkatrobins

    Internet Explorer Addon

    kitkatrobins, Oct 24, 2007, in forum: C++
    Replies:
    8
    Views:
    567
    Alf P. Steinbach
    Nov 20, 2007
  2. Amar Kapadia

    Utilities/Addon for Creating Tables

    Amar Kapadia, May 15, 2005, in forum: ASP .Net Web Controls
    Replies:
    6
    Views:
    144
    Amar Kapadia
    May 16, 2005
  3. WT

    Searching for a powerfull calendar addon

    WT, Nov 14, 2006, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    144
  4. Tumurbaatar S.

    IE addon

    Tumurbaatar S., Jan 29, 2004, in forum: ASP General
    Replies:
    1
    Views:
    144
    Dave Anderson
    Jan 29, 2004
  5. Julian Harnath

    Problem building Ruby addon with Vista

    Julian Harnath, Dec 23, 2007, in forum: Ruby
    Replies:
    2
    Views:
    150
    Julian Harnath
    Dec 23, 2007
Loading...

Share This Page