view silvermirror/interface.py @ 27:a648f57b1921

STUB: silvermirror/hg.py
author Jeff Hammel <k0scist@gmail.com>
date Fri, 31 Jan 2014 19:26:34 -0800
parents 9b139702a8f9
children
line wrap: on
line source

#!/usr/bin/env python
"""
interface for Reflector backends
"""

def notimplemented(func):
    """
    mark a function as not implemented
    TODO: calling should raise a NotImplementedError 
    """
    func.notimplemented = True
    return func

class Reflector(object):

    def __init__(self):
        pass
    
    ### API

    @notimplemented
    def sync(self):
        """
        synchronize
        """

### for testing notimplemented decorator

class Foo(object):

    @notimplemented
    def bar(self):
        "stufff"

    @notimplemented
    def fleem(self):
        pass

    @notimplemented
    def foox(self):
        pass

class Bar(Foo):

    def bar(self):
        return 1

    @notimplemented
    def fleem(self):
        pass

if __name__ == '__main__':
    foo = Foo()
    bar = Bar()
    import pdb; pdb.set_trace()