Update of /cvsroot/freevo/freevo/src In directory sc8-pr-cvs1:/tmp/cvs-serv22789
Modified Files: plugin.py Log Message: add a function to search if a plugin is active Index: plugin.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/plugin.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** plugin.py 20 Sep 2003 09:42:12 -0000 1.43 --- plugin.py 20 Sep 2003 15:07:45 -0000 1.44 *************** *** 10,13 **** --- 10,16 ---- # ----------------------------------------------------------------------- # $Log$ + # Revision 1.44 2003/09/20 15:07:45 dischi + # add a function to search if a plugin is active + # # Revision 1.43 2003/09/20 09:42:12 dischi # do not eval the args *************** *** 214,218 **** ! def init(callback = None): --- 217,243 ---- ! def is_active(name, arg=None): ! """ ! search the list if the given plugin is active. If arg is set, ! check arg, too. ! """ ! global __all_plugins__ ! for p in __all_plugins__: ! if p[0] == name: ! if not arg: ! return True ! if isinstance(arg, list) or isinstance(arg, tuple): ! try: ! for i in range(len(arg)): ! if arg[i] != p[3][i]: ! break ! else: ! return True ! except: ! pass ! if arg == p[3]: ! return True ! return False ! def init(callback = None): ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Freevo-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freevo-cvslog