Metadata-Version: 1.0
Name: hatch
Version: 0.9
Summary: A framework for extending Python apps
Home-page: https://github.com/geniphi/hatch/
Author: Te-je Rodgers
Author-email: te-je@geniphi.com
License: MIT/X11
Description: =====
        Hatch
        =====
        
        Hatch is an easy to use framework for loading extensions into Python
        applications. No really, it is::
        
            import hatch
        
            class DummyInterface(hatch.Interface):
                def method(self):
                    pass
        
            for instance in DummyInterace.instances():
                # Loop through all implementations of the interface that were
                # found in plugins
                print instance.method()
        
        
        Or you can take this code out for a spin in your interactive
        interpreter::
        
            >>>import hatch
            >>>class IObserve(hatch.Interface):
            ...    @classmethod
            ...    def notify(cls):
            ...        cls.apply('notify')
            ...
            >>>class SnippyObserver(object):
            ...    def notify(self):
            ...        print "Doesn't hatch have a better way to do this?"
            ...
            >>>class CleverObserver(object):
            ...    def notify(self):
            ...        print "That's not the point..."
            ...
            >>>hatch.add_internal_extension('__main__.IObserve', SnippyObserver)
            >>>hatch.add_internal_extension('__main__.IObserve', CleverObserver)
            >>>IObserve.notify()
            Doesn't hatch have a better way to do this?
            That's not the point
        
        For curious ones, the observer pattern is supported natively::
        
            >>>import hatch
            >>>def winded_observer(arg):
            ...    print "Hey, I was 'observing' and I got this message:", arg
        
            >>>def quiet_observer(arg):
            ...    print arg
        
            >>>hatch.add_internal_extension('observer_hook', winded_observer)
            >>>hatch.add_internal_extension('observer_hook', quiet_observer)
            >>>notify = hatch.Observers('observer_hook')
            >>>notify('foo')
            Hey, I was 'observing' and I got this message: foo
            foo
        
        ----------------------------
        How does it find extensions?
        ----------------------------
        
        That's up to you. Hatch can load extensions from an internal source,
        a setuptools entry point, or any other source. Telling Hatch where
        to load extensions from is just as easy as everything else::
        
            from hatch.entry_points import EpFinder
        
            hatch.register_global_finder(EpFinder('/path/to/plugin/dir'))
            # Or alternatively, to load plugins directly off sys.path:
            hatch.register_global_finder(EpFinder())
        
        Check out the ``Finders documentation`` for details on
        the different finders that you can use.
        
        --------------
        Got Questions?
        --------------
        
        You can contact me directly through xmpp (or email): te-je@geniphi.com.
        If you find a bug, use Github_ to file an issue
        (you'd really be helping me out).
        
        .. _github: https://github.com/geniphi/hatch/issues
        
Keywords: egg,extension,plugin
Platform: UNKNOWN
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Plugins
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
