You are here: Big Brother Bot ForumCommunity DevelopersThe Code BinA little change to support better inheritance
Pages: [1]   Go Down
  Print  
Author Topic: A little change to support better inheritance  (Read 1072 times) Bookmark and Share
B3 Contrib/Support
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 67
Offline Offline
« on: April 22, 2010, 04:52:31 AM »

Sometimes I want to extend the functionality of some plugins, so I write my own extending the original.

The problem is, Plugin class do not extend object, so I'm not able to call 'super'.

Of course I changed it on my branch, though it would be nice to have it in the official core so I can share some of my plugins that make use of it.

Regards.
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Online Online
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #1 on: April 22, 2010, 05:57:34 AM »

No need either. Let say you extends the welcome plugin :

Code: python
from b3.plugins.welcome import WelcomePlugin
class MyWelcomePlugin(WelcomePlugin):
   def __init__(self, console, config):
       WelcomePlugin.__init__(self, console, plugin)
Logged

Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal