7 from sys
import version_info
as _swig_python_version_info
8 if _swig_python_version_info < (2, 7, 0):
9 raise RuntimeError(
'Python 2.7 or later required')
12 if __package__
or '.' in __name__:
13 from .
import _Pltk_init
18 import builtins
as __builtin__
24 return self.this.own(value)
26 if type(value).__name__ ==
'SwigPyObject':
27 self.__dict__[name] = value
29 method = class_type.__swig_setmethods__.get(name,
None)
31 return method(self, value)
33 object.__setattr__(self, name, value)
35 raise AttributeError(
"You cannot add attributes to %s" % self)
44 return self.this.own()
45 method = class_type.__swig_getmethods__.get(name,
None)
48 raise AttributeError(
"'%s' object has no attribute '%s'" % (class_type.__name__, name))
53 strthis =
"proxy of " + self.this.__repr__()
54 except __builtin__.Exception:
56 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
60 def set_instance_attr(self, name, value):
64 set(self, name, value)
65 elif hasattr(self, name)
and isinstance(getattr(type(self), name), property):
66 set(self, name, value)
68 raise AttributeError(
"You cannot add instance attributes to %s" % self)
69 return set_instance_attr
73 def set_class_attr(cls, name, value):
74 if hasattr(cls, name)
and not isinstance(getattr(cls, name), property):
77 raise AttributeError(
"You cannot add class attributes to %s" % cls)
82 """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" 84 return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
89 """Meta class to enforce nondynamic attributes (no new attributes) for a class""" 95 return _Pltk_init.Pltk_init(x)
def _swig_setattr_nondynamic_class_variable(set)
def _swig_setattr(self, class_type, name, value)
def _swig_setattr_nondynamic(self, class_type, name, value, static=1)
def _swig_add_metaclass(metaclass)
def _swig_getattr(self, class_type, name)
def _swig_setattr_nondynamic_instance_variable(set)