PLplot  5.13.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')
11  import importlib
12  pkg = __name__.rpartition('.')[0]
13  mname = '.'.join((pkg, '_Pltk_init')).lstrip('.')
14  try:
15  return importlib.import_module(mname)
16  except ImportError:
17  return importlib.import_module('_Pltk_init')
18 _Pltk_init = swig_import_helper()
19 del swig_import_helper
20 del _swig_python_version_info
21 
22 try:
23  import builtins as __builtin__
24 except ImportError:
25  import __builtin__
26 
27 def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
28  if name == "thisown":
29  return self.this.own(value)
30  if name == "this":
31  if type(value).__name__ == 'SwigPyObject':
32  self.__dict__[name] = value
33  return
34  method = class_type.__swig_setmethods__.get(name, None)
35  if method:
36  return method(self, value)
37  if not static:
38  object.__setattr__(self, name, value)
39  else:
40  raise AttributeError("You cannot add attributes to %s" % self)
41 
42 
43 def _swig_setattr(self, class_type, name, value):
44  return _swig_setattr_nondynamic(self, class_type, name, value, 0)
45 
46 
47 def _swig_getattr(self, class_type, name):
48  if name == "thisown":
49  return self.this.own()
50  method = class_type.__swig_getmethods__.get(name, None)
51  if method:
52  return method(self)
53  raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
54 
55 
56 def _swig_repr(self):
57  try:
58  strthis = "proxy of " + self.this.__repr__()
59  except __builtin__.Exception:
60  strthis = ""
61  return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
62 
63 
65  def set_instance_attr(self, name, value):
66  if name == "thisown":
67  self.this.own(value)
68  elif name == "this":
69  set(self, name, value)
70  elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
71  set(self, name, value)
72  else:
73  raise AttributeError("You cannot add instance attributes to %s" % self)
74  return set_instance_attr
75 
76 
78  def set_class_attr(cls, name, value):
79  if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
80  set(cls, name, value)
81  else:
82  raise AttributeError("You cannot add class attributes to %s" % cls)
83  return set_class_attr
84 
85 
86 def _swig_add_metaclass(metaclass):
87  """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
88  def wrapper(cls):
89  return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
90  return wrapper
91 
92 
93 class _SwigNonDynamicMeta(type):
94  """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
95  __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)
96 
97 
98 
99 def Pltk_init(x):
100  return _Pltk_init.Pltk_init(x)
101 Pltk_init = _Pltk_init.Pltk_init
102 
103 
def _swig_setattr_nondynamic_class_variable(set)
Definition: Pltk_init.py:77
def _swig_repr(self)
Definition: Pltk_init.py:56
def _swig_setattr(self, class_type, name, value)
Definition: Pltk_init.py:43
def Pltk_init
Definition: Pltk_init.py:101
def _swig_setattr_nondynamic(self, class_type, name, value, static=1)
Definition: Pltk_init.py:27
def _swig_add_metaclass(metaclass)
Definition: Pltk_init.py:86
def _swig_getattr(self, class_type, name)
Definition: Pltk_init.py:47
def _swig_setattr_nondynamic_instance_variable(set)
Definition: Pltk_init.py:64
def swig_import_helper()
Definition: Pltk_init.py:10