Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!

Author Topic: A little change to support better inheritance  (Read 2843 times)

Offline sgt

  • B3 Contrib/Support
  • Full Member
  • *
  • Posts: 82
A little change to support better inheritance
« on: April 22, 2010, 02:52:31 PM »
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.

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4882
    • Github repository
Re: A little change to support better inheritance
« Reply #1 on: April 22, 2010, 03:57:34 PM »
No need either. Let say you extends the welcome plugin :

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

 


Rate this page +1 at Google Search