PLplot  5.14.0
Pltk_init.py
Go to the documentation of this file.
1 # This file was automatically generated by SWIG (http://www.swig.org).
2 # Version 4.0.0
3 #
4 # Do not make changes to this file unless you know what you are doing--modify
5 # the SWIG interface file instead.
6 
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')
10 
11 # Import the low-level C/C++ module
12 if __package__ or '.' in __name__:
13  from . import _Pltk_init
14 else:
15  import _Pltk_init
16 
17 try:
18  import builtins as __builtin__
19 except ImportError:
20  import __builtin__
21 
22 def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
23  if name == "thisown":
24  return self.this.own(value)
25  if name == "this":
26  if type(value).__name__ == 'SwigPyObject':
27  self.__dict__[name] = value
28  return
29  method = class_type.__swig_setmethods__.get(name, None)
30  if method:
31  return method(self, value)
32  if not static:
33  object.__setattr__(self, name, value)
34  else:
35  raise AttributeError("You cannot add attributes to %s" % self)
36 
37 
38 def _swig_setattr(self, class_type, name, value):
39  return _swig_setattr_nondynamic(self, class_type, name, value, 0)
40 
41 
42 def _swig_getattr(self, class_type, name):
43  if name == "thisown":
44  return self.this.own()
45  method = class_type.__swig_getmethods__.get(name, None)
46  if method:
47  return method(self)
48  raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
49 
50 
51 def _swig_repr(self):
52  try:
53  strthis = "proxy of " + self.this.__repr__()
54  except __builtin__.Exception:
55  strthis = ""
56  return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
57 
58 
60  def set_instance_attr(self, name, value):
61  if name == "thisown":
62  self.this.own(value)
63  elif name == "this":
64  set(self, name, value)
65  elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
66  set(self, name, value)
67  else:
68  raise AttributeError("You cannot add instance attributes to %s" % self)
69  return set_instance_attr
70 
71 
73  def set_class_attr(cls, name, value):
74  if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
75  set(cls, name, value)
76  else:
77  raise AttributeError("You cannot add class attributes to %s" % cls)
78  return set_class_attr
79 
80 
81 def _swig_add_metaclass(metaclass):
82  """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
83  def wrapper(cls):
84  return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
85  return wrapper
86 
87 
88 class _SwigNonDynamicMeta(type):
89  """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
90  __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
91 
92 
93 
94 def Pltk_init(x):
95  return _Pltk_init.Pltk_init(x)
96 
97 
def _swig_setattr_nondynamic_class_variable(set)
Definition: Pltk_init.py:72
def _swig_repr(self)
Definition: Pltk_init.py:51
def _swig_setattr(self, class_type, name, value)
Definition: Pltk_init.py:38
def Pltk_init(x)
Definition: Pltk_init.py:94
def _swig_setattr_nondynamic(self, class_type, name, value, static=1)
Definition: Pltk_init.py:22
def _swig_add_metaclass(metaclass)
Definition: Pltk_init.py:81
def _swig_getattr(self, class_type, name)
Definition: Pltk_init.py:42
def _swig_setattr_nondynamic_instance_variable(set)
Definition: Pltk_init.py:59