예제 #1
0
 def __init__(self, *arg, **kw):
     try:
         attrs = arg[2] or {}
     except IndexError:
         attrs = kw.get("attrs", {})
     si = attrs.pop("source_integrity", False)
     ti = attrs.pop("target_integrity", False)
     InterfaceClass.__init__(self, *arg, **kw)
     self.setTaggedValue("source_integrity", si)
     self.setTaggedValue("target_integrity", ti)
예제 #2
0
def _create_ABCInterface():
    # It's a two-step process to create the root ABCInterface, because
    # without specifying a corresponding ABC, using the normal constructor
    # gets us a plain InterfaceClass object, and there is no ABC to associate with the
    # root.
    abc_name_bases_attrs = ('ABCInterface', (Interface, ), {})
    instance = ABCInterfaceClass.__new__(ABCInterfaceClass,
                                         *abc_name_bases_attrs)
    InterfaceClass.__init__(instance, *abc_name_bases_attrs)
    return instance
예제 #3
0
 def __init__(self, *arg, **kw):
     try:
         attrs = arg[2] or {}
     except IndexError:
         attrs = kw.get('attrs', {})
     si = attrs.pop('source_integrity', False)
     ti = attrs.pop('target_integrity', False)
     InterfaceClass.__init__(self, *arg, **kw)
     self.setTaggedValue('source_integrity', si)
     self.setTaggedValue('target_integrity', ti)
예제 #4
0
 def __init__(self, *arg, **kw):
     try:
         attrs = arg[2] or {}
     except IndexError:
         attrs = kw.get('attrs', {})
     si = attrs.pop('source_integrity', False)
     ti = attrs.pop('target_integrity', False)
     so = attrs.pop('source_ordered', False)
     to = attrs.pop('target_ordered', False)
     InterfaceClass.__init__(self, *arg, **kw)
     self.setTaggedValue('source_integrity', si)
     self.setTaggedValue('target_integrity', ti)
     self.setTaggedValue('source_ordered', so)
     self.setTaggedValue('target_ordered', to)
예제 #5
0
 def __init__(self, *arg, **kw):
     try:
         attrs = arg[2] or {}
     except IndexError:
         attrs = kw.get('attrs', {})
     # get class attribute values and remove them
     si = attrs.pop('source_integrity', False)
     ti = attrs.pop('target_integrity', False)
     so = attrs.pop('source_ordered', False)
     to = attrs.pop('target_ordered', False)
     sif = attrs.pop('source_isheet', ISheet)
     sifa = attrs.pop('source_isheet_field', u'')
     tif = attrs.pop('target_isheet', ISheet)
     # initialize interface class
     InterfaceClass.__init__(self, *arg, **kw)
     # set tagged values based on attribute values
     self.setTaggedValue('source_integrity', si)
     self.setTaggedValue('target_integrity', ti)
     self.setTaggedValue('source_ordered', so)
     self.setTaggedValue('target_ordered', to)
     self.setTaggedValue('source_isheet', sif)
     self.setTaggedValue('source_isheet_field', sifa)
     self.setTaggedValue('target_isheet', tif)
예제 #6
0
 def __init__(self, *arg, **kw):
     try:
         attrs = arg[2] or {}
     except IndexError:
         attrs = kw.get('attrs', {})
     # get class attribute values and remove them
     si = attrs.pop('source_integrity', False)
     ti = attrs.pop('target_integrity', False)
     so = attrs.pop('source_ordered', False)
     to = attrs.pop('target_ordered', False)
     sif = attrs.pop('source_isheet', ISheet)
     sifa = attrs.pop('source_isheet_field', u'')
     tif = attrs.pop('target_isheet', ISheet)
     # initialize interface class
     InterfaceClass.__init__(self, *arg, **kw)
     # set tagged values based on attribute values
     self.setTaggedValue('source_integrity', si)
     self.setTaggedValue('target_integrity', ti)
     self.setTaggedValue('source_ordered', so)
     self.setTaggedValue('target_ordered', to)
     self.setTaggedValue('source_isheet', sif)
     self.setTaggedValue('source_isheet_field', sifa)
     self.setTaggedValue('target_isheet', tif)
예제 #7
0
 def __init__(self, name, bases=(), attrs=None, __doc__=None,
              __module__=None):
     InterfaceClass.__init__(self, name, bases, attrs, __doc__, __module__)
     self._SchemaClass_finalize()
예제 #8
0
 def __init__(self, name):
     InterfaceClass.__init__(self, name, (Interface,))
     Baz.__init__(self, name)
예제 #9
0
        return self.__abc

    def getRegisteredConformers(self):
        """
        Return an iterable of the classes that are known to conform to
        the ABC this interface parallels.
        """
        based_on = self.__abc

        # The registry only contains things that aren't already
        # known to be subclasses of the ABC. But the ABC is in charge
        # of checking that, so its quite possible that registrations
        # are in fact ignored, winding up just in the _abc_cache.
        try:
            registered = list(based_on._abc_registry) + list(based_on._abc_cache)
        except AttributeError:
            # Rewritten in C in CPython 3.7.
            # These expose the underlying weakref.
            from abc import _get_dump
            data = _get_dump(based_on)
            registry = data[0]
            cache = data[1]
            registered = [x() for x in itertools.chain(registry, cache)]
            registered = [x for x in registered if x is not None]

        return set(itertools.chain(registered, self.__extra_classes))


ABCInterface = ABCInterfaceClass.__new__(ABCInterfaceClass, None, None, None)
InterfaceClass.__init__(ABCInterface, 'ABCInterface', (Interface,), {})
예제 #10
0
 def __init__(self, name, bases=(), attrs=None, __doc__=None, __module__=None):
     InterfaceClass.__init__(self, name, bases, attrs, __doc__, __module__)
예제 #11
0
 def __init__(self, *args, **kw):
     Persistent.__init__(self)
     InterfaceClass.__init__(self, *args, **kw)
     
     self.dependents = FlexibleWeakKeyDictionary()
예제 #12
0
파일: __init__.py 프로젝트: wpjunior/proled
    def __init__(self, *args, **kw):
        Persistent.__init__(self)
        InterfaceClass.__init__(self, *args, **kw)

        self.dependents = PersistentDict()