mercurial/interfaces/util.py
changeset 43076 2372284d9457
parent 42814 2c4f656c8e9f
child 43077 687b865b95ad
equal deleted inserted replaced
43075:57875cf423c9 43076:2372284d9457
     9 # bookkeeping for declaring interfaces. So, we use stubs for various
     9 # bookkeeping for declaring interfaces. So, we use stubs for various
    10 # zope.interface primitives unless instructed otherwise.
    10 # zope.interface primitives unless instructed otherwise.
    11 
    11 
    12 from __future__ import absolute_import
    12 from __future__ import absolute_import
    13 
    13 
    14 from .. import (
    14 from .. import encoding
    15     encoding,
       
    16 )
       
    17 
    15 
    18 if encoding.environ.get('HGREALINTERFACES'):
    16 if encoding.environ.get('HGREALINTERFACES'):
    19     from ..thirdparty.zope import (
    17     from ..thirdparty.zope import interface as zi
    20         interface as zi,
       
    21     )
       
    22 
    18 
    23     Attribute = zi.Attribute
    19     Attribute = zi.Attribute
    24     Interface = zi.Interface
    20     Interface = zi.Interface
    25     implementer = zi.implementer
    21     implementer = zi.implementer
    26 else:
    22 else:
       
    23 
    27     class Attribute(object):
    24     class Attribute(object):
    28         def __init__(self, __name__, __doc__=''):
    25         def __init__(self, __name__, __doc__=''):
    29             pass
    26             pass
    30 
    27 
    31     class Interface(object):
    28     class Interface(object):
    32         def __init__(self, name, bases=(), attrs=None, __doc__=None,
    29         def __init__(
    33                  __module__=None):
    30             self, name, bases=(), attrs=None, __doc__=None, __module__=None
       
    31         ):
    34             pass
    32             pass
    35 
    33 
    36     def implementer(*ifaces):
    34     def implementer(*ifaces):
    37         def wrapper(cls):
    35         def wrapper(cls):
    38             return cls
    36             return cls