11 from sys
import version_info
12 if version_info >= (2, 6, 0):
13 def swig_import_helper():
14 from os.path
import dirname
18 fp, pathname, description = imp.find_module(
'_i2ccore', [dirname(__file__)])
24 _mod = imp.load_module(
'_i2ccore', fp, pathname, description)
28 _i2ccore = swig_import_helper()
29 del swig_import_helper
34 _swig_property = property
39 def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
40 if (name ==
"thisown"):
41 return self.this.own(value)
43 if type(value).__name__ ==
'SwigPyObject':
44 self.__dict__[name] = value
46 method = class_type.__swig_setmethods__.get(name,
None)
48 return method(self, value)
51 object.__setattr__(self, name, value)
53 self.__dict__[name] = value
55 raise AttributeError(
"You cannot add attributes to %s" % self)
58 def _swig_setattr(self, class_type, name, value):
59 return _swig_setattr_nondynamic(self, class_type, name, value, 0)
62 def _swig_getattr_nondynamic(self, class_type, name, static=1):
63 if (name ==
"thisown"):
64 return self.this.own()
65 method = class_type.__swig_getmethods__.get(name,
None)
69 return object.__getattr__(self, name)
71 raise AttributeError(name)
73 def _swig_getattr(self, class_type, name):
74 return _swig_getattr_nondynamic(self, class_type, name, 0)
79 strthis =
"proxy of " + self.this.__repr__()
82 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
87 except AttributeError:
94 def new_byteArray(nelements):
95 return _i2ccore.new_byteArray(nelements)
96 new_byteArray = _i2ccore.new_byteArray
98 def delete_byteArray(ary):
99 return _i2ccore.delete_byteArray(ary)
100 delete_byteArray = _i2ccore.delete_byteArray
102 def byteArray_getitem(ary, index):
103 return _i2ccore.byteArray_getitem(ary, index)
104 byteArray_getitem = _i2ccore.byteArray_getitem
106 def byteArray_setitem(ary, index, value):
107 return _i2ccore.byteArray_setitem(ary, index, value)
108 byteArray_setitem = _i2ccore.byteArray_setitem
111 return _i2ccore.new_uintp()
112 new_uintp = _i2ccore.new_uintp
114 def copy_uintp(value):
115 return _i2ccore.copy_uintp(value)
116 copy_uintp = _i2ccore.copy_uintp
118 def delete_uintp(obj):
119 return _i2ccore.delete_uintp(obj)
120 delete_uintp = _i2ccore.delete_uintp
122 def uintp_assign(obj, value):
123 return _i2ccore.uintp_assign(obj, value)
124 uintp_assign = _i2ccore.uintp_assign
126 def uintp_value(obj):
127 return _i2ccore.uintp_value(obj)
128 uintp_value = _i2ccore.uintp_value
130 def i2ccore_open(device):
131 return _i2ccore.i2ccore_open(device)
132 i2ccore_open = _i2ccore.i2ccore_open
134 def i2ccore_close(fd):
135 return _i2ccore.i2ccore_close(fd)
136 i2ccore_close = _i2ccore.i2ccore_close
138 def i2ccore_read(fd, cur_addr, addr, buf, count):
139 return _i2ccore.i2ccore_read(fd, cur_addr, addr, buf, count)
140 i2ccore_read = _i2ccore.i2ccore_read
142 def i2ccore_write(fd, cur_addr, addr, buf, count):
143 return _i2ccore.i2ccore_write(fd, cur_addr, addr, buf, count)
144 i2ccore_write = _i2ccore.i2ccore_write
146 def i2ccore_transfer(fd, cur_addr, addr, wbuf, wcount, rbuf, rcount):
147 return _i2ccore.i2ccore_transfer(fd, cur_addr, addr, wbuf, wcount, rbuf, rcount)
148 i2ccore_transfer = _i2ccore.i2ccore_transfer
150 def i2ccore_check(fd, cur_addr, addr):
151 return _i2ccore.i2ccore_check(fd, cur_addr, addr)
152 i2ccore_check = _i2ccore.i2ccore_check
156 RoadNarrows Robotics i2ccore Python Inline Extensions and Wrappers.