Commit 4def8c92 authored by Pavel Vainerman's avatar Pavel Vainerman

[python]: module refactoring

parent 33108cc9
......@@ -621,7 +621,7 @@ AC_CONFIG_FILES([Makefile
testsuite/Makefile
wrappers/Makefile
wrappers/python/lib/Makefile
wrappers/python/lib/pyUniSet/Makefile
wrappers/python/lib/lib/Makefile
wrappers/python/netdata-plugin/Makefile
wrappers/python/Makefile])
......
if ENABLE_PYTHON
SUBDIRS=pyUniSet
SUBDIRS=lib
#lib_LTLIBRARIES = libUniSet2Python.la
#libUniSet2Python_la_SOURCES =
......
......@@ -3,7 +3,7 @@
import sys
from .pyUniSet.pyUConnector import *
from .lib.UConnector import *
def is_id(str_id):
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from .pyUniSet.pyUniSet import *
from .lib.UniSet import *
class UInterface():
......
......@@ -5,7 +5,7 @@ import sys
from .UInterface import *
from .UGlobal import *
from .pyUniSet.pyUModbus import *
from .lib.UModbus import *
class UInterfaceModbus(UInterface):
......
......@@ -3,7 +3,7 @@
from .UInterface import *
from .UGlobal import *
from .pyUniSet.pyUConnector import *
from .lib.UConnector import *
class UInterfaceUniSet(UInterface):
......
......@@ -22,8 +22,9 @@ import urllib.request, urllib.parse, urllib.error
UHTTP_API_VERSION = 'v0'
class UHTTPError:
class UHTTPError(BaseException):
def __init__(self, err=''):
BaseException.__init__(self)
self.message = err
......
......@@ -3,8 +3,8 @@
__all__ = ["UGlobal", "UInterface", "UInterfaceModbus", "UInterfaceUniSet", "UniSetHTTP", "UniXML"]
from .pyUniSet.pyUniSet import *
from .pyUniSet.pyUModbus import *
from .pyUniSet.pyUConnector import *
from .lib.UniSet import *
from .lib.UModbus import *
from .lib.UConnector import *
from .pyUniSet.pyUExceptions import *
from .lib.UExceptions import *
if ENABLE_PYTHON
SWIG=swig
#python_SCRIPTS = pyUniSet.py pyUConnector.py pyUModbus.py pyUExceptions.py
pydir=$(pkgpythondir)/lib
py_DATA = __init__.py UniSet.py UConnector.py UModbus.py UExceptions.py
BUILD_SRCDIR=$(srcdir)/../../../core
BUILD_SRC=UModbus.cc UConnector.cc UProxyObject.cc
UniSet.py: UInterface_wrap.cxx _UniSet.la
UConnector.py: UConnector_wrap.cxx _UConnector.la
UModbus.py: _UModbus.la UModbus_wrap.cxx
UExceptions.py: _UExceptions.la
pyexec_LTLIBRARIES = _UConnector.la _UModbus.la _UExceptions.la _UniSet.la
_UniSet_la_SOURCES = PyUInterface.cc UInterface_wrap.cxx UProxyObject.cc
_UniSet_la_CXXFLAGS = -I$(BUILD_SRCDIR) $(UNISET_CFLAGS) $(UNISET_EXT_CFLAGS) $(PYTHON_CFLAGS)
_UniSet_la_LDFLAGS = -module -avoid-version
_UniSet_la_LIBADD = $(UNISET_LIBS) $(UNISET_EXT_LIBS) $(PYTHON_LIBS)
UInterface_wrap.cxx: UInterface.i UProxyObject.i PyUInterface.h $(BUILD_SRCDIR)/UProxyObject.h
$(SWIG) -python -py3 -c++ -outcurrentdir -I$(BUILD_SRCDIR) UInterface.i
#PyUObject_wrap.cxx: UObject.i PyUObject.h
# swig -python -c++ -classic UObject.i
_UConnector_la_SOURCES = UConnector.cc UConnector_wrap.cxx
_UConnector_la_CXXFLAGS = -I$(BUILD_SRCDIR) $(UNISET_CFLAGS) $(PYTHON_CFLAGS)
_UConnector_la_LDFLAGS = -module -avoid-version
_UConnector_la_LIBADD = $(UNISET_LIBS) $(PYTHON_LIBS)
UConnector_wrap.cxx: UConnector.i $(BUILD_SRCDIR)/UConnector.h
$(SWIG) -python -py3 -c++ -outcurrentdir -I$(BUILD_SRCDIR) UConnector.i
_UModbus_la_SOURCES = UModbus.cc UModbus_wrap.cxx
_UModbus_la_CXXFLAGS = -I$(BUILD_SRCDIR) $(UNISET_CFLAGS) $(UNISET_EXT_CFLAGS) $(POCO_CFLAGS) $(PYTHON_CFLAGS)
_UModbus_la_LDFLAGS = -module -avoid-version
_UModbus_la_LIBADD = $(UNISET_LIBS) $(UNISET_EXT_LIBS) $(POCO_LIBS) $(PYTHON_LIBS)
UModbus_wrap.cxx: UInterface.i $(BUILD_SRCDIR)/UModbus.h
$(SWIG) -python -py3 -c++ -outcurrentdir -I$(BUILD_SRCDIR) UModbus.i
_UExceptions_la_SOURCES = UExceptions_wrap.cxx
_UExceptions_la_CXXFLAGS = -I$(BUILD_SRCDIR) $(UNISET_CFLAGS) $(UNISET_EXT_CFLAGS) $(PYTHON_CFLAGS)
_UExceptions_la_LDFLAGS = -module -avoid-version
_UExceptions_la_LIBADD = $(UNISET_LIBS) $(UNISET_EXT_LIBS) $(PYTHON_LIBS)
UExceptions_wrap.cxx: UExceptions.i $(BUILD_SRCDIR)/UExceptions.h
$(SWIG) -python -py3 -c++ -outcurrentdir -I$(BUILD_SRCDIR) UExceptions.i
# Специальное правило для удаления сгенерированного кода
# для дальнейшей перегенерации
clean-gen:
rm -rf *.py* *_wrap.cxx
$(BUILD_SRC):
ln -sf $(BUILD_SRCDIR)/$@
all-local: $(BUILD_SRC)
include $(top_builddir)/include.mk
endif
......@@ -5,7 +5,7 @@
***********************************************************/
%include <std_string.i>
%module pyUConnector
%module UConnector
%{
#include "UConnector.h"
%}
......
......@@ -10,12 +10,12 @@ if _swig_python_version_info >= (2, 7, 0):
import importlib
pkg_parts = __name__.rpartition('.')
pkg = pkg_parts[0] if pkg_parts[1] == '.' else pkg_parts[2]
mname = '.'.join((pkg, '_pyUConnector')).lstrip('.')
mname = '.'.join((pkg, '_UConnector')).lstrip('.')
try:
return importlib.import_module(mname)
except ImportError:
return importlib.import_module('_pyUConnector')
_pyUConnector = swig_import_helper()
return importlib.import_module('_UConnector')
_UConnector = swig_import_helper()
del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
def swig_import_helper():
......@@ -23,17 +23,17 @@ elif _swig_python_version_info >= (2, 6, 0):
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_pyUConnector', [dirname(__file__)])
fp, pathname, description = imp.find_module('_UConnector', [dirname(__file__)])
except ImportError:
import _pyUConnector
return _pyUConnector
import _UConnector
return _UConnector
try:
_mod = imp.load_module('_pyUConnector', fp, pathname, description)
_mod = imp.load_module('_UConnector', fp, pathname, description)
finally:
if fp is not None:
fp.close()
return _mod
_pyUConnector = swig_import_helper()
_UConnector = swig_import_helper()
del swig_import_helper
else:
raise RuntimeError('Python 2.6 or later required')
......@@ -97,43 +97,43 @@ class Params(_object):
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Params, name)
__repr__ = _swig_repr
max = _pyUConnector.Params_max
max = _UConnector.Params_max
def __init__(self):
this = _pyUConnector.new_Params()
this = _UConnector.new_Params()
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def add(self, s: 'char *') -> "bool":
return _pyUConnector.Params_add(self, s)
return _UConnector.Params_add(self, s)
def add_str(self, s: 'std::string const') -> "bool":
return _pyUConnector.Params_add_str(self, s)
__swig_setmethods__["argc"] = _pyUConnector.Params_argc_set
__swig_getmethods__["argc"] = _pyUConnector.Params_argc_get
return _UConnector.Params_add_str(self, s)
__swig_setmethods__["argc"] = _UConnector.Params_argc_set
__swig_getmethods__["argc"] = _UConnector.Params_argc_get
if _newclass:
argc = property(_pyUConnector.Params_argc_get, _pyUConnector.Params_argc_set)
__swig_setmethods__["argv"] = _pyUConnector.Params_argv_set
__swig_getmethods__["argv"] = _pyUConnector.Params_argv_get
argc = property(_UConnector.Params_argc_get, _UConnector.Params_argc_set)
__swig_setmethods__["argv"] = _UConnector.Params_argv_set
__swig_getmethods__["argv"] = _UConnector.Params_argv_get
if _newclass:
argv = property(_pyUConnector.Params_argv_get, _pyUConnector.Params_argv_set)
argv = property(_UConnector.Params_argv_get, _UConnector.Params_argv_set)
if _newclass:
inst = staticmethod(_pyUConnector.Params_inst)
inst = staticmethod(_UConnector.Params_inst)
else:
inst = _pyUConnector.Params_inst
__swig_destroy__ = _pyUConnector.delete_Params
inst = _UConnector.Params_inst
__swig_destroy__ = _UConnector.delete_Params
__del__ = lambda self: None
Params_swigregister = _pyUConnector.Params_swigregister
Params_swigregister = _UConnector.Params_swigregister
Params_swigregister(Params)
cvar = _pyUConnector.cvar
cvar = _UConnector.cvar
DefaultID = cvar.DefaultID
DefaultSupplerID = cvar.DefaultSupplerID
def Params_inst() -> "UTypes::Params":
return _pyUConnector.Params_inst()
Params_inst = _pyUConnector.Params_inst
return _UConnector.Params_inst()
Params_inst = _UConnector.Params_inst
class ShortIOInfo(_object):
__swig_setmethods__ = {}
......@@ -141,36 +141,36 @@ class ShortIOInfo(_object):
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, ShortIOInfo, name)
__repr__ = _swig_repr
__swig_setmethods__["value"] = _pyUConnector.ShortIOInfo_value_set
__swig_getmethods__["value"] = _pyUConnector.ShortIOInfo_value_get
__swig_setmethods__["value"] = _UConnector.ShortIOInfo_value_set
__swig_getmethods__["value"] = _UConnector.ShortIOInfo_value_get
if _newclass:
value = property(_pyUConnector.ShortIOInfo_value_get, _pyUConnector.ShortIOInfo_value_set)
__swig_setmethods__["tv_sec"] = _pyUConnector.ShortIOInfo_tv_sec_set
__swig_getmethods__["tv_sec"] = _pyUConnector.ShortIOInfo_tv_sec_get
value = property(_UConnector.ShortIOInfo_value_get, _UConnector.ShortIOInfo_value_set)
__swig_setmethods__["tv_sec"] = _UConnector.ShortIOInfo_tv_sec_set
__swig_getmethods__["tv_sec"] = _UConnector.ShortIOInfo_tv_sec_get
if _newclass:
tv_sec = property(_pyUConnector.ShortIOInfo_tv_sec_get, _pyUConnector.ShortIOInfo_tv_sec_set)
__swig_setmethods__["tv_nsec"] = _pyUConnector.ShortIOInfo_tv_nsec_set
__swig_getmethods__["tv_nsec"] = _pyUConnector.ShortIOInfo_tv_nsec_get
tv_sec = property(_UConnector.ShortIOInfo_tv_sec_get, _UConnector.ShortIOInfo_tv_sec_set)
__swig_setmethods__["tv_nsec"] = _UConnector.ShortIOInfo_tv_nsec_set
__swig_getmethods__["tv_nsec"] = _UConnector.ShortIOInfo_tv_nsec_get
if _newclass:
tv_nsec = property(_pyUConnector.ShortIOInfo_tv_nsec_get, _pyUConnector.ShortIOInfo_tv_nsec_set)
__swig_setmethods__["supplier"] = _pyUConnector.ShortIOInfo_supplier_set
__swig_getmethods__["supplier"] = _pyUConnector.ShortIOInfo_supplier_get
tv_nsec = property(_UConnector.ShortIOInfo_tv_nsec_get, _UConnector.ShortIOInfo_tv_nsec_set)
__swig_setmethods__["supplier"] = _UConnector.ShortIOInfo_supplier_set
__swig_getmethods__["supplier"] = _UConnector.ShortIOInfo_supplier_get
if _newclass:
supplier = property(_pyUConnector.ShortIOInfo_supplier_get, _pyUConnector.ShortIOInfo_supplier_set)
__swig_setmethods__["supplier_node"] = _pyUConnector.ShortIOInfo_supplier_node_set
__swig_getmethods__["supplier_node"] = _pyUConnector.ShortIOInfo_supplier_node_get
supplier = property(_UConnector.ShortIOInfo_supplier_get, _UConnector.ShortIOInfo_supplier_set)
__swig_setmethods__["supplier_node"] = _UConnector.ShortIOInfo_supplier_node_set
__swig_getmethods__["supplier_node"] = _UConnector.ShortIOInfo_supplier_node_get
if _newclass:
supplier_node = property(_pyUConnector.ShortIOInfo_supplier_node_get, _pyUConnector.ShortIOInfo_supplier_node_set)
supplier_node = property(_UConnector.ShortIOInfo_supplier_node_get, _UConnector.ShortIOInfo_supplier_node_set)
def __init__(self):
this = _pyUConnector.new_ShortIOInfo()
this = _UConnector.new_ShortIOInfo()
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUConnector.delete_ShortIOInfo
__swig_destroy__ = _UConnector.delete_ShortIOInfo
__del__ = lambda self: None
ShortIOInfo_swigregister = _pyUConnector.ShortIOInfo_swigregister
ShortIOInfo_swigregister = _UConnector.ShortIOInfo_swigregister
ShortIOInfo_swigregister(ShortIOInfo)
class UConnector(_object):
......@@ -181,56 +181,56 @@ class UConnector(_object):
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUConnector.new_UConnector(*args)
this = _UConnector.new_UConnector(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUConnector.delete_UConnector
__swig_destroy__ = _UConnector.delete_UConnector
__del__ = lambda self: None
def getUIType(self) -> "std::string":
return _pyUConnector.UConnector_getUIType(self)
return _UConnector.UConnector_getUIType(self)
def getConfFileName(self) -> "std::string":
return _pyUConnector.UConnector_getConfFileName(self)
return _UConnector.UConnector_getConfFileName(self)
def getValue(self, id: 'long', node: 'long') -> "long":
return _pyUConnector.UConnector_getValue(self, id, node)
return _UConnector.UConnector_getValue(self, id, node)
def setValue(self, *args) -> "void":
return _pyUConnector.UConnector_setValue(self, *args)
return _UConnector.UConnector_setValue(self, *args)
def getTimeChange(self, *args) -> "UTypes::ShortIOInfo":
return _pyUConnector.UConnector_getTimeChange(self, *args)
return _UConnector.UConnector_getTimeChange(self, *args)
def getSensorID(self, name: 'std::string const &') -> "long":
return _pyUConnector.UConnector_getSensorID(self, name)
return _UConnector.UConnector_getSensorID(self, name)
def getNodeID(self, name: 'std::string const &') -> "long":
return _pyUConnector.UConnector_getNodeID(self, name)
return _UConnector.UConnector_getNodeID(self, name)
def getObjectID(self, name: 'std::string const &') -> "long":
return _pyUConnector.UConnector_getObjectID(self, name)
return _UConnector.UConnector_getObjectID(self, name)
def getShortName(self, id: 'long') -> "std::string":
return _pyUConnector.UConnector_getShortName(self, id)
return _UConnector.UConnector_getShortName(self, id)
def getName(self, id: 'long') -> "std::string":
return _pyUConnector.UConnector_getName(self, id)
return _UConnector.UConnector_getName(self, id)
def getTextName(self, id: 'long') -> "std::string":
return _pyUConnector.UConnector_getTextName(self, id)
return _UConnector.UConnector_getTextName(self, id)
def getObjectInfo(self, *args) -> "std::string":
return _pyUConnector.UConnector_getObjectInfo(self, *args)
return _UConnector.UConnector_getObjectInfo(self, *args)
def apiRequest(self, *args) -> "std::string":
return _pyUConnector.UConnector_apiRequest(self, *args)
return _UConnector.UConnector_apiRequest(self, *args)
def activate_objects(self) -> "void":
return _pyUConnector.UConnector_activate_objects(self)
UConnector_swigregister = _pyUConnector.UConnector_swigregister
return _UConnector.UConnector_activate_objects(self)
UConnector_swigregister = _UConnector.UConnector_swigregister
UConnector_swigregister(UConnector)
# This file is compatible with both classic and new-style classes.
......
......@@ -2754,16 +2754,16 @@ static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
/*-----------------------------------------------
@(target):= _pyUConnector.so
@(target):= _UConnector.so
------------------------------------------------*/
#if PY_VERSION_HEX >= 0x03000000
# define SWIG_init PyInit__pyUConnector
# define SWIG_init PyInit__UConnector
#else
# define SWIG_init init_pyUConnector
# define SWIG_init init_UConnector
#endif
#define SWIG_name "_pyUConnector"
#define SWIG_name "_UConnector"
#define SWIGVERSION 0x030012
#define SWIG_VERSION SWIGVERSION
......
......@@ -5,7 +5,7 @@
***********************************************************/
%include <std_string.i>
%module pyUExceptions
%module UExceptions
%{
#include "UExceptions.h"
%}
......
......@@ -10,12 +10,12 @@ if _swig_python_version_info >= (2, 7, 0):
import importlib
pkg_parts = __name__.rpartition('.')
pkg = pkg_parts[0] if pkg_parts[1] == '.' else pkg_parts[2]
mname = '.'.join((pkg, '_pyUExceptions')).lstrip('.')
mname = '.'.join((pkg, '_UExceptions')).lstrip('.')
try:
return importlib.import_module(mname)
except ImportError:
return importlib.import_module('_pyUExceptions')
_pyUExceptions = swig_import_helper()
return importlib.import_module('_UExceptions')
_UExceptions = swig_import_helper()
del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
def swig_import_helper():
......@@ -23,17 +23,17 @@ elif _swig_python_version_info >= (2, 6, 0):
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_pyUExceptions', [dirname(__file__)])
fp, pathname, description = imp.find_module('_UExceptions', [dirname(__file__)])
except ImportError:
import _pyUExceptions
return _pyUExceptions
import _UExceptions
return _UExceptions
try:
_mod = imp.load_module('_pyUExceptions', fp, pathname, description)
_mod = imp.load_module('_UExceptions', fp, pathname, description)
finally:
if fp is not None:
fp.close()
return _mod
_pyUExceptions = swig_import_helper()
_UExceptions = swig_import_helper()
del swig_import_helper
else:
raise RuntimeError('Python 2.6 or later required')
......@@ -99,22 +99,22 @@ class UException(BaseException, _object):
__repr__ = _swig_repr
def __init__(self, *args):
BaseException.__init__(self, *args)
this = _pyUExceptions.new_UException(*args)
BaseException.__init__(self, args)
this = _UExceptions.new_UException(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUExceptions.delete_UException
__swig_destroy__ = _UExceptions.delete_UException
__del__ = lambda self: None
def getError(self) -> "std::string const":
return _pyUExceptions.UException_getError(self)
__swig_setmethods__["err"] = _pyUExceptions.UException_err_set
__swig_getmethods__["err"] = _pyUExceptions.UException_err_get
return _UExceptions.UException_getError(self)
__swig_setmethods__["err"] = _UExceptions.UException_err_set
__swig_getmethods__["err"] = _UExceptions.UException_err_get
if _newclass:
err = property(_pyUExceptions.UException_err_get, _pyUExceptions.UException_err_set)
UException_swigregister = _pyUExceptions.UException_swigregister
err = property(_UExceptions.UException_err_get, _UExceptions.UException_err_set)
UException_swigregister = _UExceptions.UException_swigregister
UException_swigregister(UException)
class UTimeOut(UException):
......@@ -129,14 +129,14 @@ class UTimeOut(UException):
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUExceptions.new_UTimeOut(*args)
this = _UExceptions.new_UTimeOut(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUExceptions.delete_UTimeOut
__swig_destroy__ = _UExceptions.delete_UTimeOut
__del__ = lambda self: None
UTimeOut_swigregister = _pyUExceptions.UTimeOut_swigregister
UTimeOut_swigregister = _UExceptions.UTimeOut_swigregister
UTimeOut_swigregister(UTimeOut)
class USysError(UException):
......@@ -151,14 +151,14 @@ class USysError(UException):
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUExceptions.new_USysError(*args)
this = _UExceptions.new_USysError(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUExceptions.delete_USysError
__swig_destroy__ = _UExceptions.delete_USysError
__del__ = lambda self: None
USysError_swigregister = _pyUExceptions.USysError_swigregister
USysError_swigregister = _UExceptions.USysError_swigregister
USysError_swigregister(USysError)
class UValidateError(UException):
......@@ -173,14 +173,14 @@ class UValidateError(UException):
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUExceptions.new_UValidateError(*args)
this = _UExceptions.new_UValidateError(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUExceptions.delete_UValidateError
__swig_destroy__ = _UExceptions.delete_UValidateError
__del__ = lambda self: None
UValidateError_swigregister = _pyUExceptions.UValidateError_swigregister
UValidateError_swigregister = _UExceptions.UValidateError_swigregister
UValidateError_swigregister(UValidateError)
# This file is compatible with both classic and new-style classes.
......
......@@ -2754,16 +2754,16 @@ static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
/*-----------------------------------------------
@(target):= _pyUExceptions.so
@(target):= _UExceptions.so
------------------------------------------------*/
#if PY_VERSION_HEX >= 0x03000000
# define SWIG_init PyInit__pyUExceptions
# define SWIG_init PyInit__UExceptions
#else
# define SWIG_init init_pyUExceptions
# define SWIG_init init_UExceptions
#endif
#define SWIG_name "_pyUExceptions"
#define SWIG_name "_UExceptions"
#define SWIGVERSION 0x030012
#define SWIG_VERSION SWIGVERSION
......
......@@ -4,7 +4,7 @@
* swig -python UInterface.i
***********************************************************/
%module pyUniSet
%module UniSet
%include "std_string.i"
......
......@@ -2758,16 +2758,16 @@ static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0};
/*-----------------------------------------------
@(target):= _pyUniSet.so
@(target):= _UniSet.so
------------------------------------------------*/
#if PY_VERSION_HEX >= 0x03000000
# define SWIG_init PyInit__pyUniSet
# define SWIG_init PyInit__UniSet
#else
# define SWIG_init init_pyUniSet
# define SWIG_init init_UniSet
#endif
#define SWIG_name "_pyUniSet"
#define SWIG_name "_UniSet"
#define SWIGVERSION 0x030012
#define SWIG_VERSION SWIGVERSION
......
......@@ -5,7 +5,7 @@
***********************************************************/
%include <std_string.i>
%module pyUModbus
%module UModbus
%{
#include "UModbus.h"
%}
......
......@@ -10,12 +10,12 @@ if _swig_python_version_info >= (2, 7, 0):
import importlib
pkg_parts = __name__.rpartition('.')
pkg = pkg_parts[0] if pkg_parts[1] == '.' else pkg_parts[2]
mname = '.'.join((pkg, '_pyUModbus')).lstrip('.')
mname = '.'.join((pkg, '_UModbus')).lstrip('.')
try:
return importlib.import_module(mname)
except ImportError:
return importlib.import_module('_pyUModbus')
_pyUModbus = swig_import_helper()
return importlib.import_module('_UModbus')
_UModbus = swig_import_helper()
del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
def swig_import_helper():
......@@ -23,17 +23,17 @@ elif _swig_python_version_info >= (2, 6, 0):
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_pyUModbus', [dirname(__file__)])
fp, pathname, description = imp.find_module('_UModbus', [dirname(__file__)])
except ImportError:
import _pyUModbus
return _pyUModbus
import _UModbus
return _UModbus
try:
_mod = imp.load_module('_pyUModbus', fp, pathname, description)
_mod = imp.load_module('_UModbus', fp, pathname, description)
finally:
if fp is not None:
fp.close()
return _mod
_pyUModbus = swig_import_helper()
_UModbus = swig_import_helper()
del swig_import_helper
else:
raise RuntimeError('Python 2.6 or later required')
......@@ -99,53 +99,53 @@ class UModbus(_object):
__repr__ = _swig_repr
def __init__(self):
this = _pyUModbus.new_UModbus()
this = _UModbus.new_UModbus()
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUModbus.delete_UModbus
__swig_destroy__ = _UModbus.delete_UModbus
__del__ = lambda self: None
def getUIType(self) -> "std::string":
return _pyUModbus.UModbus_getUIType(self)
return _UModbus.UModbus_getUIType(self)
def isWriteFunction(self, mbfunc: 'int') -> "bool":
return _pyUModbus.UModbus_isWriteFunction(self, mbfunc)
return _UModbus.UModbus_isWriteFunction(self, mbfunc)
def prepare(self, ip: 'std::string const &', port: 'int') -> "void":
return _pyUModbus.UModbus_prepare(self, ip, port)
return _UModbus.UModbus_prepare(self, ip, port)
def connect(self, ip: 'std::string const &', port: 'int') -> "void":
return _pyUModbus.UModbus_connect(self, ip, port)
return _UModbus.UModbus_connect(self, ip, port)
def conn_port(self) -> "int":
return _pyUModbus.UModbus_conn_port(self)
return _UModbus.UModbus_conn_port(self)
def conn_ip(self) -> "std::string":
return _pyUModbus.UModbus_conn_ip(self)
return _UModbus.UModbus_conn_ip(self)
def isConnection(self) -> "bool":
return _pyUModbus.UModbus_isConnection(self)
return _UModbus.UModbus_isConnection(self)
def setTimeout(self, msec: 'int') -> "void":
return _pyUModbus.UModbus_setTimeout(self, msec)
return _UModbus.UModbus_setTimeout(self, msec)
def mbread(self, *args) -> "long":
return _pyUModbus.UModbus_mbread(self, *args)
return _UModbus.UModbus_mbread(self, *args)
def getWord(self, addr: 'int', mbreg: 'int', mbfunc: 'int'=0x4) -> "long":
return _pyUModbus.UModbus_getWord(self, addr, mbreg, mbfunc)
return _UModbus.UModbus_getWord(self, addr, mbreg, mbfunc)
def getByte(self, addr: 'int', mbreg: 'int', mbfunc: 'int'=0x4) -> "long":
return _pyUModbus.UModbus_getByte(self, addr, mbreg, mbfunc)
return _UModbus.UModbus_getByte(self, addr, mbreg, mbfunc)
def getBit(self, addr: 'int', mbreg: 'int', mbfunc: 'int'=0x2) -> "bool":
return _pyUModbus.UModbus_getBit(self, addr, mbreg, mbfunc)
return _UModbus.UModbus_getBit(self, addr, mbreg, mbfunc)
def mbwrite(self, *args) -> "void":
return _pyUModbus.UModbus_mbwrite(self, *args)
UModbus_swigregister = _pyUModbus.UModbus_swigregister
return _UModbus.UModbus_mbwrite(self, *args)
UModbus_swigregister = _UModbus.UModbus_swigregister
UModbus_swigregister(UModbus)
# This file is compatible with both classic and new-style classes.
......
......@@ -2751,16 +2751,16 @@ static swig_module_info swig_module = {swig_types, 2, 0, 0, 0, 0};
/*-----------------------------------------------
@(target):= _pyUModbus.so
@(target):= _UModbus.so
------------------------------------------------*/
#if PY_VERSION_HEX >= 0x03000000
# define SWIG_init PyInit__pyUModbus
# define SWIG_init PyInit__UModbus
#else
# define SWIG_init init_pyUModbus
# define SWIG_init init_UModbus
#endif
#define SWIG_name "_pyUModbus"
#define SWIG_name "_UModbus"
#define SWIGVERSION 0x030012
#define SWIG_VERSION SWIGVERSION
......
......@@ -4,7 +4,7 @@
* swig -python UInterface.i
***********************************************************/
%module pyUniSet
%module UniSet
%include <std_string.i>
......
......@@ -10,12 +10,12 @@ if _swig_python_version_info >= (2, 7, 0):
import importlib
pkg_parts = __name__.rpartition('.')
pkg = pkg_parts[0] if pkg_parts[1] == '.' else pkg_parts[2]
mname = '.'.join((pkg, '_pyUniSet')).lstrip('.')
mname = '.'.join((pkg, '_UniSet')).lstrip('.')
try:
return importlib.import_module(mname)
except ImportError:
return importlib.import_module('_pyUniSet')
_pyUniSet = swig_import_helper()
return importlib.import_module('_UniSet')
_UniSet = swig_import_helper()
del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
def swig_import_helper():
......@@ -23,17 +23,17 @@ elif _swig_python_version_info >= (2, 6, 0):
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_pyUniSet', [dirname(__file__)])
fp, pathname, description = imp.find_module('_UniSet', [dirname(__file__)])
except ImportError:
import _pyUniSet
return _pyUniSet
import _UniSet
return _UniSet
try:
_mod = imp.load_module('_pyUniSet', fp, pathname, description)
_mod = imp.load_module('_UniSet', fp, pathname, description)
finally:
if fp is not None:
fp.close()
return _mod
_pyUniSet = swig_import_helper()
_UniSet = swig_import_helper()
del swig_import_helper
else:
raise RuntimeError('Python 2.6 or later required')
......@@ -93,91 +93,91 @@ except __builtin__.Exception:
def uniset_init_params(p: 'Params', xmlfile: 'std::string const &') -> "void":
return _pyUniSet.uniset_init_params(p, xmlfile)
uniset_init_params = _pyUniSet.uniset_init_params
return _UniSet.uniset_init_params(p, xmlfile)
uniset_init_params = _UniSet.uniset_init_params
def uniset_init(argc: 'int', argv: 'char **', xmlfile: 'std::string const &') -> "void":
return _pyUniSet.uniset_init(argc, argv, xmlfile)
uniset_init = _pyUniSet.uniset_init
return _UniSet.uniset_init(argc, argv, xmlfile)
uniset_init = _UniSet.uniset_init
def uniset_activate_objects() -> "void":
return _pyUniSet.uniset_activate_objects()
uniset_activate_objects = _pyUniSet.uniset_activate_objects
return _UniSet.uniset_activate_objects()
uniset_activate_objects = _UniSet.uniset_activate_objects
def getValue(id: 'long') -> "long":
return _pyUniSet.getValue(id)
getValue = _pyUniSet.getValue
return _UniSet.getValue(id)
getValue = _UniSet.getValue
def setValue(*args) -> "void":
return _pyUniSet.setValue(*args)
setValue = _pyUniSet.setValue
return _UniSet.setValue(*args)
setValue = _UniSet.setValue
def getSensorID(name: 'std::string const &') -> "long":
return _pyUniSet.getSensorID(name)
getSensorID = _pyUniSet.getSensorID
return _UniSet.getSensorID(name)
getSensorID = _UniSet.getSensorID
def getObjectID(name: 'std::string const &') -> "long":
return _pyUniSet.getObjectID(name)
getObjectID = _pyUniSet.getObjectID
return _UniSet.getObjectID(name)
getObjectID = _UniSet.getObjectID
def getShortName(id: 'long') -> "std::string":
return _pyUniSet.getShortName(id)
getShortName = _pyUniSet.getShortName
return _UniSet.getShortName(id)
getShortName = _UniSet.getShortName
def getName(id: 'long') -> "std::string":
return _pyUniSet.getName(id)
getName = _pyUniSet.getName
return _UniSet.getName(id)
getName = _UniSet.getName
def getTextName(id: 'long') -> "std::string":
return _pyUniSet.getTextName(id)
getTextName = _pyUniSet.getTextName
return _UniSet.getTextName(id)
getTextName = _UniSet.getTextName
def getConfFileName() -> "std::string":
return _pyUniSet.getConfFileName()
getConfFileName = _pyUniSet.getConfFileName
return _UniSet.getConfFileName()
getConfFileName = _UniSet.getConfFileName
class Params(_object):
__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
max = _UniSet.Params_max
def __init__(self):
this = _pyUniSet.new_Params()
this = _UniSet.new_Params()
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
def add(self, s: 'char *') -> "bool":
return _pyUniSet.Params_add(self, s)
return _UniSet.Params_add(self, s)
def add_str(self, s: 'std::string const') -> "bool":
return _pyUniSet.Params_add_str(self, s)
__swig_setmethods__["argc"] = _pyUniSet.Params_argc_set
__swig_getmethods__["argc"] = _pyUniSet.Params_argc_get
return _UniSet.Params_add_str(self, s)
__swig_setmethods__["argc"] = _UniSet.Params_argc_set
__swig_getmethods__["argc"] = _UniSet.Params_argc_get
if _newclass:
argc = property(_pyUniSet.Params_argc_get, _pyUniSet.Params_argc_set)
__swig_setmethods__["argv"] = _pyUniSet.Params_argv_set
__swig_getmethods__["argv"] = _pyUniSet.Params_argv_get
argc = property(_UniSet.Params_argc_get, _UniSet.Params_argc_set)
__swig_setmethods__["argv"] = _UniSet.Params_argv_set
__swig_getmethods__["argv"] = _UniSet.Params_argv_get
if _newclass:
argv = property(_pyUniSet.Params_argv_get, _pyUniSet.Params_argv_set)
argv = property(_UniSet.Params_argv_get, _UniSet.Params_argv_set)
if _newclass:
inst = staticmethod(_pyUniSet.Params_inst)
inst = staticmethod(_UniSet.Params_inst)
else:
inst = _pyUniSet.Params_inst
__swig_destroy__ = _pyUniSet.delete_Params
inst = _UniSet.Params_inst
__swig_destroy__ = _UniSet.delete_Params
__del__ = lambda self: None
Params_swigregister = _pyUniSet.Params_swigregister
Params_swigregister = _UniSet.Params_swigregister
Params_swigregister(Params)
cvar = _pyUniSet.cvar
cvar = _UniSet.cvar
DefaultID = cvar.DefaultID
DefaultSupplerID = cvar.DefaultSupplerID
def Params_inst() -> "UTypes::Params":
return _pyUniSet.Params_inst()
Params_inst = _pyUniSet.Params_inst
return _UniSet.Params_inst()
Params_inst = _UniSet.Params_inst
class ShortIOInfo(_object):
__swig_setmethods__ = {}
......@@ -185,39 +185,39 @@ class ShortIOInfo(_object):
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, ShortIOInfo, name)
__repr__ = _swig_repr
__swig_setmethods__["value"] = _pyUniSet.ShortIOInfo_value_set
__swig_getmethods__["value"] = _pyUniSet.ShortIOInfo_value_get
__swig_setmethods__["value"] = _UniSet.ShortIOInfo_value_set
__swig_getmethods__["value"] = _UniSet.ShortIOInfo_value_get
if _newclass:
value = property(_pyUniSet.ShortIOInfo_value_get, _pyUniSet.ShortIOInfo_value_set)
__swig_setmethods__["tv_sec"] = _pyUniSet.ShortIOInfo_tv_sec_set
__swig_getmethods__["tv_sec"] = _pyUniSet.ShortIOInfo_tv_sec_get
value = property(_UniSet.ShortIOInfo_value_get, _UniSet.ShortIOInfo_value_set)
__swig_setmethods__["tv_sec"] = _UniSet.ShortIOInfo_tv_sec_set
__swig_getmethods__["tv_sec"] = _UniSet.ShortIOInfo_tv_sec_get
if _newclass:
tv_sec = property(_pyUniSet.ShortIOInfo_tv_sec_get, _pyUniSet.ShortIOInfo_tv_sec_set)
__swig_setmethods__["tv_nsec"] = _pyUniSet.ShortIOInfo_tv_nsec_set
__swig_getmethods__["tv_nsec"] = _pyUniSet.ShortIOInfo_tv_nsec_get
tv_sec = property(_UniSet.ShortIOInfo_tv_sec_get, _UniSet.ShortIOInfo_tv_sec_set)
__swig_setmethods__["tv_nsec"] = _UniSet.ShortIOInfo_tv_nsec_set
__swig_getmethods__["tv_nsec"] = _UniSet.ShortIOInfo_tv_nsec_get
if _newclass:
tv_nsec = property(_pyUniSet.ShortIOInfo_tv_nsec_get, _pyUniSet.ShortIOInfo_tv_nsec_set)
__swig_setmethods__["supplier"] = _pyUniSet.ShortIOInfo_supplier_set
__swig_getmethods__["supplier"] = _pyUniSet.ShortIOInfo_supplier_get
tv_nsec = property(_UniSet.ShortIOInfo_tv_nsec_get, _UniSet.ShortIOInfo_tv_nsec_set)
__swig_setmethods__["supplier"] = _UniSet.ShortIOInfo_supplier_set
__swig_getmethods__["supplier"] = _UniSet.ShortIOInfo_supplier_get
if _newclass:
supplier = property(_pyUniSet.ShortIOInfo_supplier_get, _pyUniSet.ShortIOInfo_supplier_set)
__swig_setmethods__["supplier_node"] = _pyUniSet.ShortIOInfo_supplier_node_set
__swig_getmethods__["supplier_node"] = _pyUniSet.ShortIOInfo_supplier_node_get
supplier = property(_UniSet.ShortIOInfo_supplier_get, _UniSet.ShortIOInfo_supplier_set)
__swig_setmethods__["supplier_node"] = _UniSet.ShortIOInfo_supplier_node_set
__swig_getmethods__["supplier_node"] = _UniSet.ShortIOInfo_supplier_node_get
if _newclass:
supplier_node = property(_pyUniSet.ShortIOInfo_supplier_node_get, _pyUniSet.ShortIOInfo_supplier_node_set)
supplier_node = property(_UniSet.ShortIOInfo_supplier_node_get, _UniSet.ShortIOInfo_supplier_node_set)
def __init__(self):
this = _pyUniSet.new_ShortIOInfo()
this = _UniSet.new_ShortIOInfo()
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUniSet.delete_ShortIOInfo
__swig_destroy__ = _UniSet.delete_ShortIOInfo
__del__ = lambda self: None
ShortIOInfo_swigregister = _pyUniSet.ShortIOInfo_swigregister
ShortIOInfo_swigregister = _UniSet.ShortIOInfo_swigregister
ShortIOInfo_swigregister(ShortIOInfo)
class UException(_object):
class UException(BaseException, _object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, UException, name, value)
__swig_getmethods__ = {}
......@@ -225,21 +225,22 @@ class UException(_object):
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUniSet.new_UException(*args)
BaseException.__init__(self, args)
this = _UniSet.new_UException(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUniSet.delete_UException
__swig_destroy__ = _UniSet.delete_UException
__del__ = lambda self: None
def getError(self) -> "std::string const":
return _pyUniSet.UException_getError(self)
__swig_setmethods__["err"] = _pyUniSet.UException_err_set
__swig_getmethods__["err"] = _pyUniSet.UException_err_get
return _UniSet.UException_getError(self)
__swig_setmethods__["err"] = _UniSet.UException_err_set
__swig_getmethods__["err"] = _UniSet.UException_err_get
if _newclass:
err = property(_pyUniSet.UException_err_get, _pyUniSet.UException_err_set)
UException_swigregister = _pyUniSet.UException_swigregister
err = property(_UniSet.UException_err_get, _UniSet.UException_err_set)
UException_swigregister = _UniSet.UException_swigregister
UException_swigregister(UException)
class UTimeOut(UException):
......@@ -254,14 +255,14 @@ class UTimeOut(UException):
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUniSet.new_UTimeOut(*args)
this = _UniSet.new_UTimeOut(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUniSet.delete_UTimeOut
__swig_destroy__ = _UniSet.delete_UTimeOut
__del__ = lambda self: None
UTimeOut_swigregister = _pyUniSet.UTimeOut_swigregister
UTimeOut_swigregister = _UniSet.UTimeOut_swigregister
UTimeOut_swigregister(UTimeOut)
class USysError(UException):
......@@ -276,14 +277,14 @@ class USysError(UException):
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUniSet.new_USysError(*args)
this = _UniSet.new_USysError(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUniSet.delete_USysError
__swig_destroy__ = _UniSet.delete_USysError
__del__ = lambda self: None
USysError_swigregister = _pyUniSet.USysError_swigregister
USysError_swigregister = _UniSet.USysError_swigregister
USysError_swigregister(USysError)
class UValidateError(UException):
......@@ -298,14 +299,14 @@ class UValidateError(UException):
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUniSet.new_UValidateError(*args)
this = _UniSet.new_UValidateError(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUniSet.delete_UValidateError
__swig_destroy__ = _UniSet.delete_UValidateError
__del__ = lambda self: None
UValidateError_swigregister = _pyUniSet.UValidateError_swigregister
UValidateError_swigregister = _UniSet.UValidateError_swigregister
UValidateError_swigregister(UValidateError)
class UProxyObject(_object):
......@@ -316,41 +317,41 @@ class UProxyObject(_object):
__repr__ = _swig_repr
def __init__(self, *args):
this = _pyUniSet.new_UProxyObject(*args)
this = _UniSet.new_UProxyObject(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _pyUniSet.delete_UProxyObject
__swig_destroy__ = _UniSet.delete_UProxyObject
__del__ = lambda self: None
def addToAsk(self, id: 'long') -> "void":
return _pyUniSet.UProxyObject_addToAsk(self, id)
return _UniSet.UProxyObject_addToAsk(self, id)
def askSensor(self, id: 'long') -> "void":
return _pyUniSet.UProxyObject_askSensor(self, id)
return _UniSet.UProxyObject_askSensor(self, id)
def getValue(self, id: 'long') -> "long":
return _pyUniSet.UProxyObject_getValue(self, id)
return _UniSet.UProxyObject_getValue(self, id)
def getFloatValue(self, id: 'long') -> "float":
return _pyUniSet.UProxyObject_getFloatValue(self, id)
return _UniSet.UProxyObject_getFloatValue(self, id)
def setValue(self, id: 'long', val: 'long') -> "void":
return _pyUniSet.UProxyObject_setValue(self, id, val)
return _UniSet.UProxyObject_setValue(self, id, val)
def askIsOK(self) -> "bool":
return _pyUniSet.UProxyObject_askIsOK(self)
return _UniSet.UProxyObject_askIsOK(self)
def reaskSensors(self) -> "bool":
return _pyUniSet.UProxyObject_reaskSensors(self)
return _UniSet.UProxyObject_reaskSensors(self)
def updateValues(self) -> "bool":
return _pyUniSet.UProxyObject_updateValues(self)
return _UniSet.UProxyObject_updateValues(self)
def smIsOK(self) -> "bool":
return _pyUniSet.UProxyObject_smIsOK(self)
UProxyObject_swigregister = _pyUniSet.UProxyObject_swigregister
return _UniSet.UProxyObject_smIsOK(self)
UProxyObject_swigregister = _UniSet.UProxyObject_swigregister
UProxyObject_swigregister(UProxyObject)
# This file is compatible with both classic and new-style classes.
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__all__ = ["pyUniSet", "pyUModbus", "pyUConnector", "pyUExceptions"]
__all__ = ["UniSet", "UModbus", "UConnector", "UExceptions"]
if ENABLE_PYTHON
SWIG=swig
#python_SCRIPTS = pyUniSet.py pyUConnector.py pyUModbus.py pyUExceptions.py
pydir=$(pkgpythondir)/pyUniSet
py_DATA = __init__.py pyUniSet.py pyUConnector.py pyUModbus.py pyUExceptions.py
BUILD_SRCDIR=$(srcdir)/../../../core
BUILD_SRC=UModbus.cc UConnector.cc UProxyObject.cc
pyUniSet.py: UInterface_wrap.cxx _pyUniSet.la
pyUConnector.py: UConnector_wrap.cxx _pyUConnector.la
pyUModbus.py: _pyUModbus.la UModbus_wrap.cxx
pyUExceptions.py: _pyUExceptions.la
pyexec_LTLIBRARIES = _pyUConnector.la _pyUModbus.la _pyUExceptions.la _pyUniSet.la
_pyUniSet_la_SOURCES = PyUInterface.cc UInterface_wrap.cxx UProxyObject.cc
_pyUniSet_la_CXXFLAGS = -I$(BUILD_SRCDIR) $(UNISET_CFLAGS) $(UNISET_EXT_CFLAGS) $(PYTHON_CFLAGS)
_pyUniSet_la_LDFLAGS = -module -avoid-version
_pyUniSet_la_LIBADD = $(UNISET_LIBS) $(UNISET_EXT_LIBS) $(PYTHON_LIBS)
UInterface_wrap.cxx: UInterface.i UProxyObject.i PyUInterface.h $(BUILD_SRCDIR)/UProxyObject.h
$(SWIG) -python -py3 -c++ -outcurrentdir -I$(BUILD_SRCDIR) UInterface.i
#PyUObject_wrap.cxx: UObject.i PyUObject.h
# swig -python -c++ -classic UObject.i
_pyUConnector_la_SOURCES = UConnector.cc UConnector_wrap.cxx
_pyUConnector_la_CXXFLAGS = -I$(BUILD_SRCDIR) $(UNISET_CFLAGS) $(PYTHON_CFLAGS)
_pyUConnector_la_LDFLAGS = -module -avoid-version
_pyUConnector_la_LIBADD = $(UNISET_LIBS) $(PYTHON_LIBS)
UConnector_wrap.cxx: UConnector.i $(BUILD_SRCDIR)/UConnector.h
$(SWIG) -python -py3 -c++ -outcurrentdir -I$(BUILD_SRCDIR) UConnector.i
_pyUModbus_la_SOURCES = UModbus.cc UModbus_wrap.cxx
_pyUModbus_la_CXXFLAGS = -I$(BUILD_SRCDIR) $(UNISET_CFLAGS) $(UNISET_EXT_CFLAGS) $(POCO_CFLAGS) $(PYTHON_CFLAGS)
_pyUModbus_la_LDFLAGS = -module -avoid-version
_pyUModbus_la_LIBADD = $(UNISET_LIBS) $(UNISET_EXT_LIBS) $(POCO_LIBS) $(PYTHON_LIBS)
UModbus_wrap.cxx: UInterface.i $(BUILD_SRCDIR)/UModbus.h
$(SWIG) -python -py3 -c++ -outcurrentdir -I$(BUILD_SRCDIR) UModbus.i
_pyUExceptions_la_SOURCES = UExceptions_wrap.cxx
_pyUExceptions_la_CXXFLAGS = -I$(BUILD_SRCDIR) $(UNISET_CFLAGS) $(UNISET_EXT_CFLAGS) $(PYTHON_CFLAGS)
_pyUExceptions_la_LDFLAGS = -module -avoid-version
_pyUExceptions_la_LIBADD = $(UNISET_LIBS) $(UNISET_EXT_LIBS) $(PYTHON_LIBS)
UExceptions_wrap.cxx: UExceptions.i $(BUILD_SRCDIR)/UExceptions.h
$(SWIG) -python -py3 -c++ -outcurrentdir -I$(BUILD_SRCDIR) UExceptions.i
# Специальное правило для удаления сгенерированного кода
# для дальнейшей перегенерации
clean-gen:
rm -rf *.py* *_wrap.cxx
$(BUILD_SRC):
ln -sf $(BUILD_SRCDIR)/$@
all-local: $(BUILD_SRC)
include $(top_builddir)/include.mk
endif
......@@ -30,7 +30,7 @@ import os
import sys
import uniset2
from uniset2 import UniXML
from uniset2.lib import UniXML
from subprocess import Popen, PIPE
sys.path.append("./python_modules")
......
......@@ -5,10 +5,11 @@ import sys
import time
sys.path.append('../../')
sys.path.append('../../lib/pyUniSet/')
sys.path.append('../../lib/pyUniSet/.libs')
sys.path.append('../../lib/lib/')
sys.path.append('../../lib/lib/.libs')
from lib import *
from UniSet import *
from UConnector import *
def myfunc( act ):
act['test'] = 'test'
......
......@@ -4,10 +4,10 @@
import sys
sys.path.append('../../')
sys.path.append('../../lib/pyUniSet/')
sys.path.append('../../lib/pyUniSet/.libs')
sys.path.append('../../lib/lib/')
sys.path.append('../../lib/lib/.libs')
from lib import *
from UniSet import *
if __name__ == "__main__":
......
......@@ -4,10 +4,11 @@
import sys
sys.path.append('../../')
sys.path.append('../../lib/pyUniSet/')
sys.path.append('../../lib/pyUniSet/.libs')
sys.path.append('../../lib/lib/')
sys.path.append('../../lib/lib/.libs')
from lib import *
from UniSet import *
from UModbus import *
if __name__ == "__main__":
......
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