Skip to content

Instantly share code, notes, and snippets.

@mtomwing
Last active August 29, 2015 13:56
Show Gist options
  • Save mtomwing/8890555 to your computer and use it in GitHub Desktop.
Save mtomwing/8890555 to your computer and use it in GitHub Desktop.
import abc
class Plugin(object):
'''This is the base class. It'll take care of all the lower level stuff.'''
__metaclass__ = abc.ABCMeta
class OutputPlugin(Plugin):
'''This class defines an interface for a "type" of plugin.'''
@abc.abstractmethod
def some_method_that_this_type_will_need_to_implement(self):
pass
class MyActualPlugin(OutputPlugin):
'''This is the kind of class that you'll see inside the plugin modules.'''
def some_method_that_this_type_will_need_to_implement(self):
do_work()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment