Commit 5bcdf48a authored by Pavel Vainerman's avatar Pavel Vainerman

Предварительно добавил реализацию python-модуля (перенос из uniset-testsuite)

parent 952362de
%def_enable doc
%def_enable mysql
%def_enable sqlite
%def_enable python
%define oname uniset
Name: libuniset
Version: 1.5
Release: alt10
Version: 1.6
Release: alt0.1
Summary: UniSet - library for building distributed industrial control systems
......@@ -32,6 +33,10 @@ BuildRequires: libMySQL-devel
BuildRequires: libsqlite3-devel
%endif
%if_enabled python
BuildRequires: python-devel swig
%endif
%if_enabled doc
BuildRequires: doxygen
%endif
......@@ -107,6 +112,16 @@ Obsoletes: %oname-sqlite-devel
Libraries needed to develop for uniset SQLite
%endif
%if_enabled python
%package python-modules-uniset
Group: Development/Python
Summary: python interface for libuniset
Requires: %name = %version-%release
%description python-modules-uniset
Python interface for %name
%endif
%package utils
Summary: UniSet utilities
Group: Development/Tools
......@@ -221,6 +236,14 @@ rm -f %buildroot%_libdir/*.la
%_pkgconfigdir/libUniSetSQLite.pc
%endif
%if_enabled python
%files python-modules-uniset
%dir %python_sitelibdir/%name
%python_sitelibdir/*
%python_sitelibdir/%name/*
%endif
%if_enabled doc
%files doc
%_docdir/%oname
......
......@@ -102,6 +102,26 @@ fi
AM_CONDITIONAL(HAVE_EXTENTIONS, test ${ext} = true)
#check python support
AC_MSG_CHECKING([python support])
buildpython=true
AC_ARG_ENABLE(python, AC_HELP_STRING([--disable-python], [disable Python support]),
[ if test $enableval = yes; then buildpython=true; else buildpython=false; fi],[ buildpython=true; ])
if test ${buildpython} = true; then
AC_MSG_RESULT([enabled])
dnl Python
AM_PATH_PYTHON(,,)
PKG_CHECK_MODULES(PYTHON,python,,exit)
AC_CHECK_PROG(SWIG, swig, yes, exit)
else
AC_MSG_RESULT([disabled])
fi
AM_CONDITIONAL(DISABLE_PYTHON, test ${buildpython} = false)
# check Doxygen
DOXYGEN=""
doc=true
......@@ -213,7 +233,10 @@ AC_CONFIG_FILES([Makefile
extensions/SharedMemory/Makefile
extensions/SharedMemory/libUniSetSharedMemory.pc
extensions/SharedMemoryPlus/Makefile
extensions/tests/Makefile])
extensions/tests/Makefile
python/lib/Makefile
python/lib/pyUniSet/Makefile
python/Makefile])
AC_OUTPUT
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_pyUConnector', [dirname(__file__)])
except ImportError:
import _pyUConnector
return _pyUConnector
if fp is not None:
try:
_mod = imp.load_module('_pyUConnector', fp, pathname, description)
finally:
fp.close()
return _mod
_pyUConnector = swig_import_helper()
del swig_import_helper
else:
import _pyUConnector
del version_info
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
class Params:
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Params, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Params, name)
__repr__ = _swig_repr
max = _pyUConnector.Params_max
def __init__(self):
this = _pyUConnector.new_Params()
try: self.this.append(this)
except: self.this = this
def add(self, *args): return _pyUConnector.Params_add(self, *args)
__swig_setmethods__["argc"] = _pyUConnector.Params_argc_set
__swig_getmethods__["argc"] = _pyUConnector.Params_argc_get
__swig_setmethods__["argv"] = _pyUConnector.Params_argv_set
__swig_getmethods__["argv"] = _pyUConnector.Params_argv_get
__swig_getmethods__["inst"] = lambda x: _pyUConnector.Params_inst
__swig_destroy__ = _pyUConnector.delete_Params
__del__ = lambda self : None;
Params_swigregister = _pyUConnector.Params_swigregister
Params_swigregister(Params)
cvar = _pyUConnector.cvar
DefaultID = cvar.DefaultID
def Params_inst():
return _pyUConnector.Params_inst()
Params_inst = _pyUConnector.Params_inst
class UConnector:
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, UConnector, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, UConnector, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUConnector.new_UConnector(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _pyUConnector.delete_UConnector
__del__ = lambda self : None;
def getUIType(self): return _pyUConnector.UConnector_getUIType(self)
def getConfFileName(self): return _pyUConnector.UConnector_getConfFileName(self)
def getValue(self, *args): return _pyUConnector.UConnector_getValue(self, *args)
def setValue(self, *args): return _pyUConnector.UConnector_setValue(self, *args)
def getSensorID(self, *args): return _pyUConnector.UConnector_getSensorID(self, *args)
def getNodeID(self, *args): return _pyUConnector.UConnector_getNodeID(self, *args)
def getShortName(self, *args): return _pyUConnector.UConnector_getShortName(self, *args)
def getName(self, *args): return _pyUConnector.UConnector_getName(self, *args)
def getTextName(self, *args): return _pyUConnector.UConnector_getTextName(self, *args)
UConnector_swigregister = _pyUConnector.UConnector_swigregister
UConnector_swigregister(UConnector)
# This file is compatible with both classic and new-style classes.
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_pyUExceptions', [dirname(__file__)])
except ImportError:
import _pyUExceptions
return _pyUExceptions
if fp is not None:
try:
_mod = imp.load_module('_pyUExceptions', fp, pathname, description)
finally:
fp.close()
return _mod
_pyUExceptions = swig_import_helper()
del swig_import_helper
else:
import _pyUExceptions
del version_info
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
class UException:
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, UException, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, UException, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUExceptions.new_UException(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _pyUExceptions.delete_UException
__del__ = lambda self : None;
def getError(self): return _pyUExceptions.UException_getError(self)
__swig_setmethods__["err"] = _pyUExceptions.UException_err_set
__swig_getmethods__["err"] = _pyUExceptions.UException_err_get
UException_swigregister = _pyUExceptions.UException_swigregister
UException_swigregister(UException)
class UTimeOut(UException):
__swig_setmethods__ = {}
for _s in [UException]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, UTimeOut, name, value)
__swig_getmethods__ = {}
for _s in [UException]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, UTimeOut, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUExceptions.new_UTimeOut(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _pyUExceptions.delete_UTimeOut
__del__ = lambda self : None;
UTimeOut_swigregister = _pyUExceptions.UTimeOut_swigregister
UTimeOut_swigregister(UTimeOut)
class USysError(UException):
__swig_setmethods__ = {}
for _s in [UException]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, USysError, name, value)
__swig_getmethods__ = {}
for _s in [UException]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, USysError, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUExceptions.new_USysError(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _pyUExceptions.delete_USysError
__del__ = lambda self : None;
USysError_swigregister = _pyUExceptions.USysError_swigregister
USysError_swigregister(USysError)
# This file is compatible with both classic and new-style classes.
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_pyUModbus', [dirname(__file__)])
except ImportError:
import _pyUModbus
return _pyUModbus
if fp is not None:
try:
_mod = imp.load_module('_pyUModbus', fp, pathname, description)
finally:
fp.close()
return _mod
_pyUModbus = swig_import_helper()
del swig_import_helper
else:
import _pyUModbus
del version_info
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
class UModbus:
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, UModbus, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, UModbus, name)
__repr__ = _swig_repr
def __init__(self):
this = _pyUModbus.new_UModbus()
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _pyUModbus.delete_UModbus
__del__ = lambda self : None;
def getUIType(self): return _pyUModbus.UModbus_getUIType(self)
def isWriteFunction(self, *args): return _pyUModbus.UModbus_isWriteFunction(self, *args)
def prepare(self, *args): return _pyUModbus.UModbus_prepare(self, *args)
def connect(self, *args): return _pyUModbus.UModbus_connect(self, *args)
def conn_port(self): return _pyUModbus.UModbus_conn_port(self)
def conn_ip(self): return _pyUModbus.UModbus_conn_ip(self)
def isConnection(self): return _pyUModbus.UModbus_isConnection(self)
def setTimeout(self, *args): return _pyUModbus.UModbus_setTimeout(self, *args)
def mbread(self, *args): return _pyUModbus.UModbus_mbread(self, *args)
def getWord(self, *args): return _pyUModbus.UModbus_getWord(self, *args)
def getByte(self, *args): return _pyUModbus.UModbus_getByte(self, *args)
def getBit(self, *args): return _pyUModbus.UModbus_getBit(self, *args)
def mbwrite(self, *args): return _pyUModbus.UModbus_mbwrite(self, *args)
UModbus_swigregister = _pyUModbus.UModbus_swigregister
UModbus_swigregister(UModbus)
class Params:
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Params, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Params, name)
__repr__ = _swig_repr
max = _pyUModbus.Params_max
def __init__(self):
this = _pyUModbus.new_Params()
try: self.this.append(this)
except: self.this = this
def add(self, *args): return _pyUModbus.Params_add(self, *args)
__swig_setmethods__["argc"] = _pyUModbus.Params_argc_set
__swig_getmethods__["argc"] = _pyUModbus.Params_argc_get
__swig_setmethods__["argv"] = _pyUModbus.Params_argv_set
__swig_getmethods__["argv"] = _pyUModbus.Params_argv_get
__swig_getmethods__["inst"] = lambda x: _pyUModbus.Params_inst
__swig_destroy__ = _pyUModbus.delete_Params
__del__ = lambda self : None;
Params_swigregister = _pyUModbus.Params_swigregister
Params_swigregister(Params)
cvar = _pyUModbus.cvar
DefaultID = cvar.DefaultID
def Params_inst():
return _pyUModbus.Params_inst()
Params_inst = _pyUModbus.Params_inst
# This file is compatible with both classic and new-style classes.
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_pyUniSet', [dirname(__file__)])
except ImportError:
import _pyUniSet
return _pyUniSet
if fp is not None:
try:
_mod = imp.load_module('_pyUniSet', fp, pathname, description)
finally:
fp.close()
return _mod
_pyUniSet = swig_import_helper()
del swig_import_helper
else:
import _pyUniSet
del version_info
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
def uniset_init_params(*args):
return _pyUniSet.uniset_init_params(*args)
uniset_init_params = _pyUniSet.uniset_init_params
def uniset_init(*args):
return _pyUniSet.uniset_init(*args)
uniset_init = _pyUniSet.uniset_init
def getValue(*args):
return _pyUniSet.getValue(*args)
getValue = _pyUniSet.getValue
def setValue(*args):
return _pyUniSet.setValue(*args)
setValue = _pyUniSet.setValue
def getSensorID(*args):
return _pyUniSet.getSensorID(*args)
getSensorID = _pyUniSet.getSensorID
def getShortName(*args):
return _pyUniSet.getShortName(*args)
getShortName = _pyUniSet.getShortName
def getName(*args):
return _pyUniSet.getName(*args)
getName = _pyUniSet.getName
def getTextName(*args):
return _pyUniSet.getTextName(*args)
getTextName = _pyUniSet.getTextName
def getConfFileName():
return _pyUniSet.getConfFileName()
getConfFileName = _pyUniSet.getConfFileName
class Params:
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Params, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Params, name)
__repr__ = _swig_repr
max = _pyUniSet.Params_max
def __init__(self):
this = _pyUniSet.new_Params()
try: self.this.append(this)
except: self.this = this
def add(self, *args): return _pyUniSet.Params_add(self, *args)
__swig_setmethods__["argc"] = _pyUniSet.Params_argc_set
__swig_getmethods__["argc"] = _pyUniSet.Params_argc_get
__swig_setmethods__["argv"] = _pyUniSet.Params_argv_set
__swig_getmethods__["argv"] = _pyUniSet.Params_argv_get
__swig_getmethods__["inst"] = lambda x: _pyUniSet.Params_inst
__swig_destroy__ = _pyUniSet.delete_Params
__del__ = lambda self : None;
Params_swigregister = _pyUniSet.Params_swigregister
Params_swigregister(Params)
cvar = _pyUniSet.cvar
DefaultID = cvar.DefaultID
def Params_inst():
return _pyUniSet.Params_inst()
Params_inst = _pyUniSet.Params_inst
class UException(Exception):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, UException, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, UException, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUniSet.new_UException(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _pyUniSet.delete_UException
__del__ = lambda self : None;
def getError(self): return _pyUniSet.UException_getError(self)
__swig_setmethods__["err"] = _pyUniSet.UException_err_set
__swig_getmethods__["err"] = _pyUniSet.UException_err_get
UException_swigregister = _pyUniSet.UException_swigregister
UException_swigregister(UException)
class UTimeOut(UException):
__swig_setmethods__ = {}
for _s in [UException]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, UTimeOut, name, value)
__swig_getmethods__ = {}
for _s in [UException]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, UTimeOut, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUniSet.new_UTimeOut(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _pyUniSet.delete_UTimeOut
__del__ = lambda self : None;
UTimeOut_swigregister = _pyUniSet.UTimeOut_swigregister
UTimeOut_swigregister(UTimeOut)
class USysError(UException):
__swig_setmethods__ = {}
for _s in [UException]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, USysError, name, value)
__swig_getmethods__ = {}
for _s in [UException]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, USysError, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUniSet.new_USysError(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _pyUniSet.delete_USysError
__del__ = lambda self : None;
USysError_swigregister = _pyUniSet.USysError_swigregister
USysError_swigregister(USysError)
# This file is compatible with both classic and new-style classes.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment