[pytango] 278/483: a test of sip
Sandor Bodo-Merle
sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:50 UTC 2017
This is an automated email from the git hooks/post-receive script.
sbodomerle-guest pushed a commit to annotated tag bliss_8.10
in repository pytango.
commit 8a267ac8f9e235c61d5f7452dc4980d09b010b39
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date: Fri Sep 13 18:31:00 2013 +0000
a test of sip
git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@23649 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
src/sip/AttributeInfo.sip | 114 ++++++++++++++
src/sip/CommandInfo.sip | 131 ++++++++++++++++
src/sip/Database.sip | 193 ++++++++++++++++++++++++
src/sip/DbData.sip | 23 +++
src/sip/DbDatum.sip | 199 ++++++++++++++++++++++++
src/sip/DbDevImportInfo.sip | 37 +++++
src/sip/DbDevInfo.sip | 36 +++++
src/sip/DeviceAttributeConfig.sip | 50 ++++++
src/sip/DeviceInfo.sip | 36 +++++
src/sip/DeviceProxy.sip | 233 ++++++++++++++++++++++++++++
src/sip/Tango.sip | 59 ++++++++
src/sip/__init_tango.py | 77 ++++++++++
src/sip/release.py | 70 +++++++++
src/sip/setup.cfg | 2 +
src/sip/setup.py | 309 ++++++++++++++++++++++++++++++++++++++
15 files changed, 1569 insertions(+)
diff --git a/src/sip/AttributeInfo.sip b/src/sip/AttributeInfo.sip
new file mode 100644
index 0000000..c30e8a7
--- /dev/null
+++ b/src/sip/AttributeInfo.sip
@@ -0,0 +1,114 @@
+/*******************************************************************************
+
+ This file is part of PyTango, a python binding for Tango
+
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+
+ Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+
+ PyTango is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ PyTango is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+struct AttributeInfo : DeviceAttributeConfig
+{
+%TypeHeaderCode
+#include <tango.h>
+using namespace Tango;
+%End
+
+ DispLevel disp_level;
+
+ bool operator==(const AttributeInfo &);
+};
+
+%MappedType AttributeInfoList
+{
+%TypeHeaderCode
+#include <vector>
+#include <tango.h>
+using namespace Tango;
+%End
+
+%ConvertToTypeCode
+ // See if we are just being asked to check the type of the Python
+ // object.
+ if(sipIsErr == NULL)
+ {
+ bool aReturnFlag = PyList_Check(sipPy);
+ for(int i = 0; aReturnFlag && i < PySequence_Size(sipPy); ++i)
+ {
+ aReturnFlag = sipCanConvertToType(PySequence_ITEM(sipPy, i),
+ sipType_AttributeInfo,
+ SIP_NOT_NONE);
+ }
+ return aReturnFlag;
+ }
+
+ AttributeInfoList *attrInfoList = new AttributeInfoList();
+ for(int i = 0; i < PySequence_Size(sipPy); ++i)
+ {
+ int state;
+ AttributeInfo *aAttributeInfo = reinterpret_cast<AttributeInfo*>(
+ sipConvertToType(PySequence_ITEM(sipPy, i),
+ sipType_AttributeInfo, Py_None,
+ SIP_NOT_NONE,
+ &state, sipIsErr));
+ // Deal with any errors.
+ if (*sipIsErr)
+ {
+ sipReleaseType(aAttributeInfo, sipType_AttributeInfo, state);
+
+ // Tidy up.
+ delete attrInfoList;
+
+ // There is no temporary instance.
+ return 0;
+ }
+ attrInfoList->push_back(*aAttributeInfo);
+ sipReleaseType(aAttributeInfo, sipType_AttributeInfo, state);
+ }
+ *sipCppPtr = attrInfoList;
+ return sipGetState(sipTransferObj);
+%End
+
+%ConvertFromTypeCode
+ PyObject *l;
+
+ // Create the Python list of the correct length.
+ if (!(l = PyList_New(sipCpp->size())))
+ return NULL;
+
+ // Go through each element in the C++ instance and convert it to a
+ // wrapped AttributeInfo
+ int i = 0;
+ for(std::vector<AttributeInfo>::iterator j = sipCpp->begin();
+ j != sipCpp->end(); ++j, ++i)
+ {
+ AttributeInfo *aAttributeInfo = new AttributeInfo(*j);
+ PyObject *wobj;
+
+ if (!(wobj = sipConvertFromNewType(aAttributeInfo, sipType_AttributeInfo, sipTransferObj)))
+ {
+ // There was an error so garbage collect the Python list.
+ Py_DECREF(l);
+ return NULL;
+ }
+ PyList_SET_ITEM(l, i, wobj);
+ }
+ delete sipCpp;
+ return l;
+%End
+};
+
diff --git a/src/sip/CommandInfo.sip b/src/sip/CommandInfo.sip
new file mode 100644
index 0000000..a46a282
--- /dev/null
+++ b/src/sip/CommandInfo.sip
@@ -0,0 +1,131 @@
+/*******************************************************************************
+
+ This file is part of PyTango, a python binding for Tango
+
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+
+ Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+
+ PyTango is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ PyTango is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+struct DevCommandInfo
+{
+%TypeHeaderCode
+#include <tango.h>
+using namespace Tango;
+%End
+
+ std::string cmd_name;
+ long cmd_tag;
+ long in_type;
+ long out_type;
+ std::string in_type_desc;
+ std::string out_type_desc;
+
+ bool operator==(const DevCommandInfo &);
+};
+
+struct CommandInfo : DevCommandInfo
+{
+%TypeHeaderCode
+#include <tango.h>
+using namespace Tango;
+%End
+
+ DispLevel disp_level;
+
+ bool operator==(const CommandInfo &);
+};
+
+%MappedType CommandInfoList
+{
+%TypeHeaderCode
+#include <vector>
+#include <tango.h>
+using namespace Tango;
+%End
+
+%ConvertToTypeCode
+ // See if we are just being asked to check the type of the Python
+ // object.
+ if(sipIsErr == NULL)
+ {
+ bool aReturnFlag = PyList_Check(sipPy);
+ for(int i = 0; aReturnFlag && i < PySequence_Size(sipPy); ++i)
+ {
+ aReturnFlag = sipCanConvertToType(PySequence_ITEM(sipPy, i),
+ sipType_CommandInfo,
+ SIP_NOT_NONE);
+ }
+ return aReturnFlag;
+ }
+
+ CommandInfoList *cmdInfoList = new CommandInfoList();
+ for(int i = 0; i < PySequence_Size(sipPy); ++i)
+ {
+ int state;
+ CommandInfo *aCommandInfo = reinterpret_cast<CommandInfo*>(
+ sipConvertToType(PySequence_ITEM(sipPy, i),
+ sipType_CommandInfo, Py_None,
+ SIP_NOT_NONE,
+ &state, sipIsErr));
+ // Deal with any errors.
+ if (*sipIsErr)
+ {
+ sipReleaseType(aCommandInfo, sipType_CommandInfo, state);
+
+ // Tidy up.
+ delete cmdInfoList;
+
+ // There is no temporary instance.
+ return 0;
+ }
+ cmdInfoList->push_back(*aCommandInfo);
+ sipReleaseType(aCommandInfo, sipType_CommandInfo, state);
+ }
+ *sipCppPtr = cmdInfoList;
+ return sipGetState(sipTransferObj);
+%End
+
+%ConvertFromTypeCode
+ PyObject *l;
+
+ // Create the Python list of the correct length.
+ if (!(l = PyList_New(sipCpp->size())))
+ return NULL;
+
+ // Go through each element in the C++ instance and convert it to a
+ // wrapped CommandInfo
+ int i = 0;
+ for(std::vector<CommandInfo>::iterator j = sipCpp->begin();
+ j != sipCpp->end(); ++j, ++i)
+ {
+ CommandInfo *aCommandInfo = new CommandInfo(*j);
+ PyObject *wobj;
+
+ if (!(wobj = sipConvertFromNewType(aCommandInfo, sipType_CommandInfo, sipTransferObj)))
+ {
+ // There was an error so garbage collect the Python list.
+ Py_DECREF(l);
+ return NULL;
+ }
+ PyList_SET_ITEM(l, i, wobj);
+ }
+ delete sipCpp;
+ return l;
+%End
+};
+
diff --git a/src/sip/Database.sip b/src/sip/Database.sip
new file mode 100644
index 0000000..205ea81
--- /dev/null
+++ b/src/sip/Database.sip
@@ -0,0 +1,193 @@
+/*******************************************************************************
+
+ This file is part of PyTango, a python binding for Tango
+
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+
+ Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+
+ PyTango is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ PyTango is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+class Database : Connection {
+
+%TypeHeaderCode
+#include <tango.h>
+using namespace Tango;
+%End
+
+private:
+ virtual std::string get_corba_name(bool);
+ virtual std::string build_corba_name();
+ virtual int get_lock_ctr();
+ virtual void set_lock_ctr(int);
+ virtual std::string dev_name();
+
+public :
+ Database();
+ Database(std::string &host, int port);
+ Database(std::string &file);
+
+ Database(const Database &);
+//// Database & operator=(const Database &);
+
+ void write_filedatabase();
+ void reread_filedatabase();
+ void write_event_channel_ior_filedatabase(std::string &);
+ void build_connection ();
+ void post_reconnection();
+
+
+//// inline Device_var &get_dbase() { return device;}
+ void check_tango_host(const char *);
+ AccessControlType check_access_control(std::string &);
+ bool is_control_access_checked();
+ void set_access_checked(bool val);
+
+// void set_tango_utils(Tango::Util *ptr);
+ int get_server_release();
+
+// DevErrorList &get_access_except_errors();
+ void clear_access_except_errors();
+ bool is_command_allowed(std::string &,std::string &);
+
+ bool is_multi_tango_host();
+ std::vector<std::string> &get_multi_host();
+ std::vector<std::string> &get_multi_port();
+
+ const std::string &get_file_name();
+
+//#ifdef _TG_WINDOWS_
+// Database(CORBA::ORB *orb,std::string &,std::string &);
+// long get_tango_host_from_reg(char **,std::string &,std::string &);
+//#endif
+
+//
+// general methods
+//
+
+ std::string get_info();
+
+ DbDatum get_host_list();
+ DbDatum get_host_list(std::string &);
+ DbDatum get_services(std::string &,std::string &);
+ void register_service(std::string &,std::string &,std::string &);
+ void unregister_service(std::string &,std::string &);
+// CORBA::Any *fill_server_cache(std::string &,std::string &);
+
+/*
+//
+// device methods
+//
+
+ void add_device(DbDevInfo&);
+ void delete_device(std::string);
+ DbDevImportInfo import_device(std::string &);
+ void export_device(DbDevExportInfo &);
+ void unexport_device(std::string);
+
+ DbDatum get_device_name(std::string &, std::string &,DbServerCache *dsc);
+ DbDatum get_device_name(std::string &, std::string &);
+ DbDatum get_device_exported(std::string &);
+ DbDatum get_device_domain(std::string &);
+ DbDatum get_device_family(std::string &);
+ DbDatum get_device_member(std::string &);
+ void get_device_alias(std::string,std::string &);
+ void get_alias(std::string,std::string &);
+ DbDatum get_device_alias_list(std::string &);
+ std::string get_class_for_device(std::string &);
+ DbDatum get_class_inheritance_for_device(std::string &);
+ DbDatum get_device_exported_for_class(std::string &);
+ void put_device_alias(std::string &,std::string &);
+ void delete_device_alias(std::string &);
+
+//
+// server methods
+//
+ void add_server(std::string &, DbDevInfos&);
+ void delete_server(std::string &);
+ void export_server(DbDevExportInfos &);
+ void unexport_server(std::string &);
+
+ DbServerInfo get_server_info(std::string &);
+ void put_server_info(DbServerInfo &);
+ void delete_server_info(std::string &);
+ DbDatum get_server_class_list(std::string &);
+ DbDatum get_server_name_list();
+ DbDatum get_instance_name_list(std::string &);
+ DbDatum get_server_list();
+ DbDatum get_server_list(std::string &);
+ DbDatum get_host_server_list(std::string &);
+ DbDatum get_device_class_list(std::string &);
+
+//
+// property methods
+//
+
+ void get_property(std::string, DbData &,DbServerCache *dsc);
+ void get_property(std::string st, DbData &db) {get_property(st,db,NULL);}
+ void get_property_forced(std::string, DbData &,DbServerCache *dsc = NULL);
+ void put_property(std::string, DbData &);
+ void delete_property(std::string, DbData &);
+ vector<DbHistory> get_property_history(std::string &,std::string &);
+ DbDatum get_object_list(std::string &);
+ DbDatum get_object_property_list(std::string &,std::string &);
+
+ void get_device_property(std::string, DbData &, DbServerCache *dsc);
+ void get_device_property(std::string st, DbData &db) {get_device_property(st,db,NULL);}
+ void put_device_property(std::string, DbData &);
+ void delete_device_property(std::string, DbData &);
+ vector<DbHistory> get_device_property_history(std::string &,std::string &);
+ DbDatum get_device_property_list(std::string &,std::string &);
+ void get_device_property_list(std::string &,const std::string &,vector<std::string> &,DbServerCache *dsc = NULL);
+
+ void get_device_attribute_property(std::string, DbData &, DbServerCache *dsc);
+ void get_device_attribute_property(std::string st, DbData &db) {get_device_attribute_property(st,db,NULL);}
+ void put_device_attribute_property(std::string, DbData &);
+ void delete_device_attribute_property(std::string, DbData &);
+ void delete_all_device_attribute_property(std::string, DbData &);
+ vector<DbHistory> get_device_attribute_property_history(std::string &,std::string &,std::string &);
+
+ void get_class_property(std::string, DbData &, DbServerCache *dsc);
+ void get_class_property(std::string st,DbData &db) {get_class_property(st,db,NULL);}
+ void put_class_property(std::string, DbData &);
+ void delete_class_property(std::string, DbData &);
+ vector<DbHistory> get_class_property_history(std::string &,std::string &);
+ DbDatum get_class_list(std::string &);
+ DbDatum get_class_property_list(std::string &);
+
+ void get_class_attribute_property(std::string, DbData &, DbServerCache *dsc);
+ void get_class_attribute_property(std::string st,DbData &db) {get_class_attribute_property(st,db,NULL);}
+ void put_class_attribute_property(std::string, DbData &);
+ void delete_class_attribute_property(std::string, DbData &);
+ vector<DbHistory> get_class_attribute_property_history(std::string &,std::string &,std::string &);
+ DbDatum get_class_attribute_list(std::string &,std::string &);
+
+
+// attribute methods
+
+ void get_attribute_alias(std::string, std::string&);
+ DbDatum get_attribute_alias_list(std::string &);
+ void put_attribute_alias(std::string &,std::string &);
+ void delete_attribute_alias(std::string &);
+
+// event methods
+
+ void export_event(DevVarstd::stringArray *);
+ void unexport_event(std::string &);
+ CORBA::Any *import_event(std::string &);
+*/
+};
+
diff --git a/src/sip/DbData.sip b/src/sip/DbData.sip
new file mode 100644
index 0000000..9cdda72
--- /dev/null
+++ b/src/sip/DbData.sip
@@ -0,0 +1,23 @@
+/*******************************************************************************
+
+ This file is part of PyTango, a python binding for Tango
+
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+
+ Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+
+ PyTango is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ PyTango is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
diff --git a/src/sip/DbDatum.sip b/src/sip/DbDatum.sip
new file mode 100644
index 0000000..2409caf
--- /dev/null
+++ b/src/sip/DbDatum.sip
@@ -0,0 +1,199 @@
+/*******************************************************************************
+
+ This file is part of PyTango, a python binding for Tango
+
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+
+ Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+
+ PyTango is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ PyTango is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+//
+// DbDatum - data object for sending and receiving data from the
+// TANGO database api
+//
+class DbDatum
+{
+
+%TypeHeaderCode
+#include <tango.h>
+using namespace Tango;
+%End
+
+public :
+ enum except_flags
+ {
+ isempty_flag,
+ wrongtype_flag,
+ numFlags
+ };
+
+ std::string name;
+ std::vector<std::string> value_string;
+
+//
+// constructor methods
+//
+ DbDatum();
+ DbDatum (const char *);
+ ~DbDatum();
+ DbDatum(const DbDatum &);
+// DbDatum &operator=(const DbDatum &);
+
+// size_t size();
+ bool is_empty();
+
+//// void exceptions(bitset<numFlags> fl) { exceptions_flags = fl;}
+//// bitset<numFlags> exceptions() {return exceptions_flags;}
+ void reset_exceptions(except_flags fl);
+ void set_exceptions(except_flags fl);
+
+//
+// insert methods
+//
+/*
+ void operator << (bool);
+ void operator << (short);
+ void operator << (unsigned char);
+ void operator << (unsigned short);
+ void operator << (DevLong);
+ void operator << (DevULong);
+ void operator << (DevLong64);
+ void operator << (DevULong64);
+ void operator << (float);
+ void operator << (double);
+ void operator << (char *);
+// void operator << (char *&);
+ void operator << (const char *);
+// void operator << (const char *&);
+ void operator << (std::string&);
+
+ void operator << (vector<std::string>&);
+ void operator << (vector<short>&);
+ void operator << (vector<unsigned short>&);
+ void operator << (vector<DevLong>&);
+ void operator << (vector<DevULong>&);
+ void operator << (vector<DevLong64>&);
+ void operator << (vector<DevULong64>&);
+ void operator << (vector<float>&);
+ void operator << (vector<double>&);
+
+//
+// extract methods
+//
+
+ bool operator >> (bool&);
+ bool operator >> (short&);
+ bool operator >> (unsigned char&);
+ bool operator >> (unsigned short&);
+ bool operator >> (DevLong&);
+ bool operator >> (DevULong&);
+ bool operator >> (DevLong64&);
+ bool operator >> (DevULong64&);
+ bool operator >> (float&);
+ bool operator >> (double&);
+ bool operator >> (const char*&);
+ bool operator >> (std::string&);
+
+ bool operator >> (vector<std::string>&);
+ bool operator >> (vector<short>&);
+ bool operator >> (vector<unsigned short>&);
+ bool operator >> (vector<DevLong>&);
+ bool operator >> (vector<DevULong>&);
+ bool operator >> (vector<DevLong64>&);
+ bool operator >> (vector<DevULong64>&);
+ bool operator >> (vector<float>&);
+ bool operator >> (vector<double>&);
+*/
+};
+
+%MappedType DbData
+{
+%TypeHeaderCode
+#include <vector>
+#include <tango.h>
+using namespace Tango;
+%End
+
+%ConvertToTypeCode
+ // See if we are just being asked to check the type of the Python
+ // object.
+ if(sipIsErr == NULL)
+ {
+ bool aReturnFlag = PyList_Check(sipPy);
+ for(int i = 0; aReturnFlag && i < PySequence_Size(sipPy); ++i)
+ {
+ aReturnFlag = sipCanConvertToType(PySequence_ITEM(sipPy, i),
+ sipType_DbDatum,
+ SIP_NOT_NONE);
+ }
+ return aReturnFlag;
+ }
+
+ DbData *dbDatumList = new DbData();
+ for(int i = 0; i < PySequence_Size(sipPy); ++i)
+ {
+ int state;
+ DbDatum *aDbDatum = reinterpret_cast<DbDatum*>(
+ sipConvertToType(PySequence_ITEM(sipPy, i),
+ sipType_DbDatum, Py_None,
+ SIP_NOT_NONE,
+ &state, sipIsErr));
+ // Deal with any errors.
+ if (*sipIsErr)
+ {
+ sipReleaseType(aDbDatum, sipType_DbDatum, state);
+
+ // Tidy up.
+ delete dbDatumList;
+
+ // There is no temporary instance.
+ return 0;
+ }
+ dbDatumList->push_back(*aDbDatum);
+ sipReleaseType(aDbDatum, sipType_DbDatum, state);
+ }
+ *sipCppPtr = dbDatumList;
+ return sipGetState(sipTransferObj);
+%End
+
+%ConvertFromTypeCode
+ PyObject *l;
+
+ // Create the Python list of the correct length.
+ if (!(l = PyList_New(sipCpp->size())))
+ return NULL;
+
+ // Go through each element in the C++ instance and convert it to a
+ // wrapped DbDatum
+ int i = 0;
+ for(std::vector<DbDatum>::iterator j = sipCpp->begin();
+ j != sipCpp->end(); ++j, ++i)
+ {
+ DbDatum *aDbDatum = new DbDatum(*j);
+ PyObject *wobj;
+
+ if (!(wobj = sipConvertFromNewType(aDbDatum, sipType_DbDatum, sipTransferObj)))
+ {
+ // There was an error so garbage collect the Python list.
+ Py_DECREF(l);
+ return NULL;
+ }
+ PyList_SET_ITEM(l, i, wobj);
+ }
+ return l;
+%End
+};
diff --git a/src/sip/DbDevImportInfo.sip b/src/sip/DbDevImportInfo.sip
new file mode 100644
index 0000000..805b51d
--- /dev/null
+++ b/src/sip/DbDevImportInfo.sip
@@ -0,0 +1,37 @@
+/*******************************************************************************
+
+ This file is part of PyTango, a python binding for Tango
+
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+
+ Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+
+ PyTango is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ PyTango is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+class DbDevImportInfo
+{
+
+%TypeHeaderCode
+#include <tango.h>
+using namespace Tango;
+%End
+
+public :
+ std::string name;
+ long exported;
+ std::string ior;
+ std::string version;
+};
\ No newline at end of file
diff --git a/src/sip/DbDevInfo.sip b/src/sip/DbDevInfo.sip
new file mode 100644
index 0000000..ab186ad
--- /dev/null
+++ b/src/sip/DbDevInfo.sip
@@ -0,0 +1,36 @@
+/*******************************************************************************
+
+ This file is part of PyTango, a python binding for Tango
+
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+
+ Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+
+ PyTango is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ PyTango is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+class DbDevInfo
+{
+
+%TypeHeaderCode
+#include <tango.h>
+using namespace Tango;
+%End
+
+public :
+ std::string name;
+ std::string _class;
+ std::string server;
+};
\ No newline at end of file
diff --git a/src/sip/DeviceAttributeConfig.sip b/src/sip/DeviceAttributeConfig.sip
new file mode 100644
index 0000000..8b0468b
--- /dev/null
+++ b/src/sip/DeviceAttributeConfig.sip
@@ -0,0 +1,50 @@
+/*******************************************************************************
+
+ This file is part of PyTango, a python binding for Tango
+
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+
+ Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+
+ PyTango is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ PyTango is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+struct DeviceAttributeConfig
+{
+%TypeHeaderCode
+#include <tango.h>
+using namespace Tango;
+%End
+ std::string name;
+ AttrWriteType writable;
+ AttrDataFormat data_format;
+ int data_type;
+ int max_dim_x;
+ int max_dim_y;
+ std::string description;
+ std::string label;
+ std::string unit;
+ std::string standard_unit;
+ std::string display_unit;
+ std::string format;
+ std::string min_value;
+ std::string max_value;
+ std::string min_alarm;
+ std::string max_alarm;
+ std::string writable_attr_name;
+ std::vector<std::string> extensions;
+
+ bool operator==(const DeviceAttributeConfig &);
+};
diff --git a/src/sip/DeviceInfo.sip b/src/sip/DeviceInfo.sip
new file mode 100644
index 0000000..5051803
--- /dev/null
+++ b/src/sip/DeviceInfo.sip
@@ -0,0 +1,36 @@
+/*******************************************************************************
+
+ This file is part of PyTango, a python binding for Tango
+
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+
+ Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+
+ PyTango is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ PyTango is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+struct DeviceInfo
+{
+%TypeHeaderCode
+#include <tango.h>
+using namespace Tango;
+%End
+ std::string dev_class;
+ std::string server_id;
+ std::string server_host;
+ long server_version;
+ std::string doc_url;
+ std::string dev_type;
+};
diff --git a/src/sip/DeviceProxy.sip b/src/sip/DeviceProxy.sip
new file mode 100644
index 0000000..1393963
--- /dev/null
+++ b/src/sip/DeviceProxy.sip
@@ -0,0 +1,233 @@
+/*******************************************************************************
+
+ This file is part of PyTango, a python binding for Tango
+
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+
+ Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+
+ PyTango is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ PyTango is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+class DeviceProxy : Connection {
+
+%TypeHeaderCode
+#include <tango.h>
+using namespace Tango;
+%End
+
+protected:
+ virtual std::string get_corba_name(bool);
+ virtual std::string build_corba_name();
+ virtual int get_lock_ctr();
+ virtual void set_lock_ctr(int);
+
+public:
+ DeviceProxy();
+ DeviceProxy(const char *, bool ch_access);
+ DeviceProxy(const char *);
+
+ DeviceProxy(const DeviceProxy &);
+// DeviceProxy & operator=(const DeviceProxy &);
+
+//
+// general methods
+//
+
+ virtual const DeviceInfo & info();
+ virtual std::string dev_name();
+ virtual void parse_name(std::string &);
+ virtual Database *get_device_db();
+
+ virtual std::string status();
+ virtual DevState state();
+ virtual std::string adm_name();
+ virtual std::string description();
+ virtual std::string name();
+ virtual std::string alias();
+
+ virtual int ping();
+
+ virtual std::vector<std::string>* black_box(int);
+
+//
+// device methods
+//
+ virtual CommandInfo command_query(std::string);
+ virtual CommandInfoList* command_list_query();
+
+
+ virtual DbDevImportInfo import_info();
+//
+// property methods
+//
+ virtual void get_property(std::string& /In/, DbData& /Out/);
+ virtual void get_property(std::vector<std::string> /In/, DbData& /Out/);
+ virtual void get_property(DbData&);
+ virtual void put_property(DbData& /In/);
+ virtual void delete_property(std::string& /In/);
+ virtual void delete_property(std::vector<std::string>& /In/);
+ virtual void delete_property(DbData& /In/);
+ virtual void get_property_list(const std::string &, std::vector<std::string> & /Out/);
+
+//
+// attribute methods
+//
+ virtual std::vector<std::string> *get_attribute_list();
+
+ virtual AttributeInfoList *get_attribute_config(std::vector<std::string>&);
+ /*
+ virtual AttributeInfoListEx *get_attribute_config_ex(std::vector<std::string>&);
+ virtual AttributeInfoEx get_attribute_config(const std::string &);
+
+ virtual AttributeInfoEx attribute_query(std::string name) {return get_attribute_config(name);}
+ virtual AttributeInfoList *attribute_list_query();
+ virtual AttributeInfoListEx *attribute_list_query_ex();
+
+ virtual void set_attribute_config(AttributeInfoList &);
+ virtual void set_attribute_config(AttributeInfoListEx &);
+
+ virtual DeviceAttribute read_attribute(std::string&);
+ virtual DeviceAttribute read_attribute(const char *at) {std::string str(at);return read_attribute(str);}
+ void read_attribute(const char *,DeviceAttribute &);
+ void read_attribute(std::string &at,DeviceAttribute &da) {read_attribute(at.c_str(),da);}
+ virtual std::vector<DeviceAttribute> *read_attributes(std::vector<std::string>&);
+
+ virtual void write_attribute(DeviceAttribute&);
+ virtual void write_attributes(std::vector<DeviceAttribute>&);
+
+ virtual DeviceAttribute write_read_attribute(DeviceAttribute &);
+
+//
+// history methods
+//
+ virtual std::vector<DeviceDataHistory> *command_history(std::string &,int);
+ virtual std::vector<DeviceDataHistory> *command_history(const char *na,int n)
+ {std::string str(na);return command_history(str,n);}
+
+ virtual std::vector<DeviceAttributeHistory> *attribute_history(std::string &,int);
+ virtual std::vector<DeviceAttributeHistory> *attribute_history(const char *na,int n)
+ {std::string str(na);return attribute_history(str,n);}
+//
+// Polling administration methods
+//
+ virtual std::vector<std::string> *polling_status();
+
+ virtual void poll_command(std::string &, int);
+ virtual void poll_command(const char *na, int per) {std::string tmp(na);poll_command(tmp,per);}
+ virtual void poll_attribute(std::string &, int);
+ virtual void poll_attribute(const char *na, int per) {std::string tmp(na);poll_attribute(tmp,per);}
+
+ virtual int get_command_poll_period(std::string &);
+ virtual int get_command_poll_period(const char *na)
+ {std::string tmp(na);return get_command_poll_period(tmp);}
+ virtual int get_attribute_poll_period(std::string &);
+ virtual int get_attribute_poll_period(const char *na)
+ {std::string tmp(na);return get_attribute_poll_period(tmp);}
+
+ virtual bool is_command_polled(std::string &);
+ virtual bool is_command_polled(const char *na) {std::string tmp(na);return is_command_polled(tmp);}
+ virtual bool is_attribute_polled(std::string &);
+ virtual bool is_attribute_polled(const char *na) {std::string tmp(na);return is_attribute_polled(tmp);}
+
+ virtual void stop_poll_command(std::string &);
+ virtual void stop_poll_command(const char *na) {std::string tmp(na);stop_poll_command(tmp);}
+ virtual void stop_poll_attribute(std::string &);
+ virtual void stop_poll_attribute(const char *na) {std::string tmp(na);stop_poll_attribute(tmp);}
+//
+// Asynchronous methods
+//
+ virtual long read_attribute_asynch(const char *na) {std::string tmp(na);return read_attribute_asynch(tmp);}
+ virtual long read_attribute_asynch(std::string &att_name);
+ virtual long read_attributes_asynch(std::vector <std::string> &);
+
+ virtual std::vector<DeviceAttribute> *read_attributes_reply(long);
+ virtual std::vector<DeviceAttribute> *read_attributes_reply(long,long);
+ virtual DeviceAttribute *read_attribute_reply(long);
+ virtual DeviceAttribute *read_attribute_reply(long,long);
+
+ virtual long write_attribute_asynch(DeviceAttribute &);
+ virtual long write_attributes_asynch(std::vector<DeviceAttribute> &);
+
+ virtual void write_attributes_reply(long);
+ virtual void write_attributes_reply(long,long);
+ virtual void write_attribute_reply(long id) {write_attributes_reply(id);}
+ virtual void write_attribute_reply(long to,long id) {write_attributes_reply(to,id);}
+
+ virtual long pending_asynch_call(asyn_req_type req)
+ {if (req == POLLING)return pasyn_ctr;
+ else if (req==CALL_BACK) return pasyn_cb_ctr;
+ else return (pasyn_ctr + pasyn_cb_ctr);}
+
+ virtual void read_attributes_asynch(std::vector<std::string> &,CallBack &);
+ virtual void read_attribute_asynch(const char *na,CallBack &cb) {std::string tmp(na);read_attribute_asynch(tmp,cb);}
+ virtual void read_attribute_asynch(std::string &,CallBack &);
+
+ virtual void write_attribute_asynch(DeviceAttribute &,CallBack &);
+ virtual void write_attributes_asynch(std::vector<DeviceAttribute> &,CallBack &);
+//
+// Logging administration methods
+//
+#ifdef TANGO_HAS_LOG4TANGO
+ virtual void add_logging_target(const std::string &target_type_name);
+ virtual void add_logging_target(const char *target_type_name)
+ {add_logging_target(std::string(target_type_name));}
+
+ virtual void remove_logging_target(const std::string &target_type_name);
+ virtual void remove_logging_target(const char *target_type_name)
+ {remove_logging_target(std::string(target_type_name));}
+
+ virtual std::vector<std::string> get_logging_target (void);
+ virtual int get_logging_level (void);
+ virtual void set_logging_level (int level);
+#endif // TANGO_HAS_LOG4TANGO
+//
+// Event methods
+//
+ virtual int subscribe_event(const std::string &attr_name, EventType event, CallBack *,
+ const std::vector<std::string> &filters); // For compatibility with Tango < 8
+ virtual int subscribe_event(const std::string &attr_name, EventType event, CallBack *,
+ const std::vector<std::string> &filters, bool stateless); // For compatibility with Tango < 8
+ virtual int subscribe_event(const std::string &attr_name, EventType event, int event_queue_size,
+ const std::vector<std::string> &filters, bool stateless = false); // For compatibility with Tango < 8
+
+ virtual int subscribe_event(const std::string &attr_name, EventType event, CallBack *);
+ virtual int subscribe_event(const std::string &attr_name, EventType event, CallBack *,bool stateless);
+ virtual int subscribe_event(const std::string &attr_name, EventType event, int event_queue_size,bool stateless = false);
+
+ virtual void unsubscribe_event(int event_id);
+//
+// Methods to access data in event queues
+//
+ virtual void get_events (int event_id, EventDataList &event_list);
+ virtual void get_events (int event_id, AttrConfEventDataList &event_list);
+ virtual void get_events (int event_id, DataReadyEventDataList &event_list);
+ virtual void get_events (int event_id, CallBack *cb);
+ virtual int event_queue_size(int event_id);
+ virtual TimeVal get_last_event_date(int event_id);
+ virtual bool is_event_queue_empty(int event_id);
+
+//
+// Locking methods
+//
+ virtual void lock(int lock_validity=DEFAULT_LOCK_VALIDITY);
+ virtual void unlock(bool force=false);
+ virtual std::string locking_status();
+ virtual bool is_locked();
+ virtual bool is_locked_by_me();
+ virtual bool get_locker(LockerInfo &);
+*/
+};
+
diff --git a/src/sip/Tango.sip b/src/sip/Tango.sip
new file mode 100644
index 0000000..3218ea2
--- /dev/null
+++ b/src/sip/Tango.sip
@@ -0,0 +1,59 @@
+/*******************************************************************************
+
+ This file is part of PyTango, a python binding for Tango
+
+ http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+
+ Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+
+ PyTango is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ PyTango is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+
+*******************************************************************************/
+
+%Module Tango 008001000
+
+%Timeline { TANGO_7_2 TANGO_8_0 TANGO_8_1 }
+
+%Platforms {WIN32_PLATFORM POSIX_PLATFORM MACOS_PLATFORM}
+
+%Include std_utils.sip
+%Include constants.sip
+%Include CommandInfo.sip
+%Include DeviceInfo.sip
+%Include DeviceAttributeConfig.sip
+%Include AttributeInfo.sip
+%Include DbDatum.sip
+%Include DbDevInfo.sip
+%Include DbDevImportInfo.sip
+%Include connection.sip
+%Include DeviceProxy.sip
+%Include Database.sip
+
+%PostInitialisationCode
+
+ PyObject* init_tango = PyImport_ImportModule("__init_tango");
+ if (init_tango == NULL)
+ {
+ if (!PyErr_Occurred())
+ {
+
+ }
+ return;
+ }
+ PyObject* init_name = PyString_FromString("init");
+ PyObject* ret = PyObject_CallMethodObjArgs(init_tango, init_name, sipModule, sipModuleDict, NULL);
+ Py_DECREF(init_name);
+ Py_DECREF(ret);
+ Py_DECREF(init_tango);
+%End
diff --git a/src/sip/__init_tango.py b/src/sip/__init_tango.py
new file mode 100644
index 0000000..9ee2fc1
--- /dev/null
+++ b/src/sip/__init_tango.py
@@ -0,0 +1,77 @@
+################################################################################
+##
+## This file is part of PyTango, a python binding for Tango
+##
+## http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+##
+## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+##
+## PyTango is free software: you can redistribute it and/or modify
+## it under the terms of the GNU Lesser General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+##
+## PyTango is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public License
+## along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+##
+################################################################################
+
+import collections
+
+def __inc_param(obj, name):
+ ret = not name.startswith('_')
+ ret &= not name in ('except_flags',)
+ ret &= not isinstance(getattr(obj, name), collections.Callable)
+ return ret
+
+def __single_param(obj, param_name, f=repr, fmt='%s = %s'):
+ param_value = getattr(obj, param_name)
+ return fmt % (param_name, f(param_value))
+
+def __struct_params_s(obj, separator=', ', f=repr, fmt='%s = %s'):
+ """method wrapper for printing all elements of a struct"""
+ s = separator.join([__single_param(obj, n, f, fmt) for n in dir(obj) if __inc_param(obj, n)])
+ return s
+
+def __struct_params_repr(obj):
+ """method wrapper for representing all elements of a struct"""
+ return __struct_params_s(obj)
+
+def __struct_params_str(obj, fmt, f=repr):
+ """method wrapper for printing all elements of a struct."""
+ return __struct_params_s(obj, '\n', f=f, fmt=fmt)
+
+def __repr__Struct(self):
+ """repr method for struct"""
+ return '%s(%s)' % (self.__class__.__name__, __struct_params_repr(self))
+
+def __str__Struct_Helper(self, f=repr):
+ """str method for struct"""
+ attrs = [ n for n in dir(self) if __inc_param(self, n)]
+ fmt = attrs and '%%%ds=%%s' % max(map(len, attrs)) or "%s = %s"
+ return '%s(\n%s)\n' % (self.__class__.__name__, __struct_params_str(self, fmt, f))
+
+def __str__Struct(self):
+ return __str__Struct_Helper(self, f=repr)
+
+def __registerStructStr(Tango):
+ """helper method to register str and repr methods for structures"""
+ structs = (Tango.DeviceInfo, Tango.DbDevImportInfo, Tango.DbDatum,
+ Tango.AttributeInfo)
+
+ for struct in structs:
+ struct.__str__ = __str__Struct
+ struct.__repr__ = __repr__Struct
+
+def __pprint_init(Tango):
+ __registerStructStr(Tango)
+
+
+def init(Tango, Tangodict):
+ __pprint_init(Tango)
+ return 1
diff --git a/src/sip/release.py b/src/sip/release.py
new file mode 100644
index 0000000..4e72786
--- /dev/null
+++ b/src/sip/release.py
@@ -0,0 +1,70 @@
+################################################################################
+##
+## This file is part of PyTango, a python binding for Tango
+##
+## http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+##
+## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+##
+## PyTango is free software: you can redistribute it and/or modify
+## it under the terms of the GNU Lesser General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+##
+## PyTango is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public License
+## along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+##
+################################################################################
+
+"""
+This is an internal PyTango module.
+"""
+
+__all__ = [ "Release" ]
+
+__docformat__ = "restructuredtext"
+
+class Release:
+ """
+ Release information:
+ - name : (str) package name
+ - version_info : (tuple<int,int,int,str,int>) The five components
+ of the version number: major, minor, micro, releaselevel, and
+ serial.
+ - version : (str) package version in format <major>.<minor>.<micro>
+ - version_long : (str) package version in format
+ <major>.<minor>.<micro><releaselevel><serial>
+ - version_description : (str) short description for the current
+ version
+ - version_number : (int) <major>*100 + <minor>*10 + <micro>
+ - description : (str) package description
+ - long_description : (str) longer package description
+ - authors : (dict<str(last name), tuple<str(full name),str(email)>>)
+ package authors
+ - url : (str) package url
+ - download_url : (str) package download url
+ - platform : (seq<str>) list of available platforms
+ - keywords : (seq<str>) list of keywords
+ - license : (str) the license"""
+ name = 'PyTango'
+ version_info = (8, 1, 0, 'dev', 0)
+ version = '.'.join(map(str, version_info[:3]))
+ version_long = version + ''.join(map(str, version_info[3:]))
+ version_description = 'This version implements the C++ Tango 8.1 API.'
+ version_number = int(version.replace('.',''))
+ description = 'A python binding for the Tango control system'
+ long_description = 'This module implements the Python Tango Device API ' \
+ 'mapping.'
+ license = 'LGPL'
+ authors = { 'Coutinho' : ('Tiago Coutinho' , 'coutinho at esrf.fr') }
+ author_lines = "\n".join([ "%s <%s>" % x for x in authors.values()])
+ url = 'http://www.tango-controls.org/static/PyTango/'
+ download_url = 'http://pypi.python.org/packages/source/P/PyTango'
+ platform = ['Linux', 'Windows XP/Vista/7/8']
+ keywords = ['Tango', 'CORBA', 'binding']
+
diff --git a/src/sip/setup.cfg b/src/sip/setup.cfg
new file mode 100644
index 0000000..0e215a3
--- /dev/null
+++ b/src/sip/setup.cfg
@@ -0,0 +1,2 @@
+[build_ext]
+sip-opts = -e -g -w
\ No newline at end of file
diff --git a/src/sip/setup.py b/src/sip/setup.py
new file mode 100644
index 0000000..ae6ca90
--- /dev/null
+++ b/src/sip/setup.py
@@ -0,0 +1,309 @@
+################################################################################
+##
+## This file is part of PyTango, a python binding for Tango
+##
+## http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+##
+## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+##
+## PyTango is free software: you can redistribute it and/or modify
+## it under the terms of the GNU Lesser General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+##
+## PyTango is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public License
+## along with PyTango. If not, see <http://www.gnu.org/licenses/>.
+##
+################################################################################
+
+import os
+import sys
+import imp
+import struct
+import platform
+import subprocess
+
+from distutils.core import setup, Extension
+from distutils.unixccompiler import UnixCCompiler
+from distutils.version import StrictVersion as V
+
+import sipdistutils
+
+
+def abspath(*path):
+ """A method to determine absolute path for a given relative path to the
+ directory where this setup.py script is located"""
+ setup_dir = os.path.dirname(os.path.abspath(__file__))
+ return os.path.join(setup_dir, *path)
+
+
+def get_release_info():
+ import release
+ return release.Release
+
+
+def uniquify(seq):
+ no_dups = []
+ [ no_dups.append(i) for i in seq if not no_dups.count(i) ]
+ return no_dups
+
+
+class build_ext(sipdistutils.build_ext):
+
+ def build_extensions(self):
+ self.use_cpp_0x = False
+ if isinstance(self.compiler, UnixCCompiler):
+ compiler_pars = self.compiler.compiler_so
+ while '-Wstrict-prototypes' in compiler_pars:
+ del compiler_pars[compiler_pars.index('-Wstrict-prototypes')]
+ #self.compiler.compiler_so = " ".join(compiler_pars)
+
+ # mimic tango check to activate C++0x extension
+ compiler = self.compiler.compiler
+ pipe = subprocess.Popen(compiler + ["-dumpversion"], stdout=subprocess.PIPE).stdout
+ gcc_ver = pipe.readlines()[0].decode().strip()
+ if V(gcc_ver) >= V("4.3.3"):
+ self.use_cpp_0x = True
+ sipdistutils.build_ext.build_extensions(self)
+
+ def build_extension(self, ext):
+ if self.use_cpp_0x:
+ ext.extra_compile_args += ['-std=c++0x']
+ ext.define_macros += [ ('PYTANGO_HAS_UNIQUE_PTR', '1') ]
+ sipdistutils.build_ext.build_extension(self, ext)
+
+
+def main():
+ ZMQ_ROOT = LOG4TANGO_ROOT = OMNI_ROOT = TANGO_ROOT = '/usr'
+
+ TANGO_ROOT = os.environ.get('TANGO_ROOT', TANGO_ROOT)
+ OMNI_ROOT = os.environ.get('OMNI_ROOT', OMNI_ROOT)
+ LOG4TANGO_ROOT = os.environ.get('LOG4TANGO_ROOT', LOG4TANGO_ROOT)
+ ZMQ_ROOT = os.environ.get('ZMQ_ROOT', ZMQ_ROOT)
+
+ Release = get_release_info()
+
+ author = Release.authors['Coutinho']
+
+ please_debug = False
+
+ packages = [
+ 'Tango',
+ ]
+
+ provides = [
+ 'Tango',
+ ]
+
+ requires = [
+ 'sip (>=4.10)',
+ 'numpy (>=1.1)'
+ ]
+
+ classifiers = [
+ 'Development Status :: 2 - Pre-Alpha',
+ 'Environment :: Other Environment',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: GNU Library or Lesser General Public License v3 (LGPLv3)',
+ 'Natural Language :: English',
+ 'Operating System :: Microsoft :: Windows',
+ 'Operating System :: POSIX',
+ 'Operating System :: POSIX :: Linux',
+ 'Operating System :: Unix',
+ 'Operating System :: MacOS',
+ 'Programming Language :: C',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 3',
+ 'Topic :: Scientific/Engineering',
+ 'Topic :: Software Development :: Libraries',
+ ]
+
+ #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
+ # include directories
+ #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
+
+ include_dirs = [ ]
+
+ _tango_root_inc = os.path.join(TANGO_ROOT, 'include')
+ include_dirs.append(_tango_root_inc)
+
+ # $TANGO_ROOT/include/tango exists since tango 7.2.0
+ # we changed the PyTango code include statements from:
+ # #include <tango.h> to:
+ # #include <tango/tango.h>
+ # However tango itself complains that it doesn't know his own header files
+ # if we don't add the $TANGO_ROOT/include/tango directory to the path. So we do it
+ # here
+ _tango_root_inc = os.path.join(_tango_root_inc, 'tango')
+ if os.path.isdir(_tango_root_inc):
+ include_dirs.append(_tango_root_inc)
+
+ include_dirs.append(os.path.join(OMNI_ROOT, 'include'))
+ include_dirs.append(os.path.join(LOG4TANGO_ROOT, 'include'))
+
+ #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
+ # library directories
+ #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
+
+ libraries = [
+ 'tango',
+ 'log4tango',
+ 'zmq',
+ ]
+
+ extra_compile_args = []
+
+ extra_link_args = []
+
+ macros = []
+
+ library_dirs = []
+ for f in (TANGO_ROOT, LOG4TANGO_ROOT, ZMQ_ROOT):
+ is64 = 8 * struct.calcsize("P") == 64
+ d = os.path.join(f, 'lib')
+ if is64:
+ d = os.path.join(f, 'lib64')
+ try:
+ if not os.stat(d): raise Exception('%s_doesnt_exist' % d)
+ except: d = os.path.join(f, 'lib')
+ library_dirs.append(d)
+
+ if os.name == 'nt':
+ include_dirs += [ ]
+
+ if please_debug:
+ libraries += [
+ #'libboost_python-vc80-mt-1_38', Boost in windows autodetects the
+ #proper library to link itself with...
+ 'omniORB414d_rt',
+ 'omniDynamic414d_rt',
+ 'omnithread34d_rt',
+ 'COS414d_rt',
+ ]
+ extra_compile_args += []
+ extra_link_args += ['/DEBUG']
+ macros += [ ('_DEBUG', None) ]
+ else:
+ libraries += [
+ #'libboost_python-vc80-mt-1_38', Boost in windows autodetects the
+ #proper library to link itself with...
+ 'omniORB414_rt',
+ 'omniDynamic414_rt',
+ 'omnithread34_rt',
+ 'COS414_rt',
+ ]
+
+ library_dirs += [ os.path.join(OMNI_ROOT, 'lib', 'x86_win32') ]
+
+ extra_compile_args += [
+ '/EHsc',
+ '/wd4005', # supress redefinition of HAVE_STRFTIME between python and omniORB
+ '/wd4996', # same as /D_SCL_SECURE_NO_WARNINGS
+ '/wd4250', # supress base class inheritance warning
+ ]
+
+ extra_link_args += []
+
+ macros += [
+ #('_WINDOWS', None),
+ #('_USRDLL', None),
+ #('_TANGO_LIB', None),
+ #('JPG_USE_ASM', None),
+ ('LOG4TANGO_HAS_DLL', None),
+ ('TANGO_HAS_DLL', None),
+ ('WIN32', None),
+ ]
+
+ else:
+ if please_debug:
+ extra_compile_args += ['-g', '-O0']
+ extra_link_args += ['-g' , '-O0']
+
+ libraries += [
+ 'pthread',
+ 'rt',
+ 'dl',
+ 'omniORB4',
+ 'omniDynamic4',
+ 'omnithread',
+ 'COS4',
+ ]
+
+ is64 = 8 * struct.calcsize("P") == 64
+ omni_lib = os.path.join(OMNI_ROOT, 'lib')
+ if is64:
+ omni_lib = os.path.join(OMNI_ROOT, 'lib64')
+ try:
+ if not os.stat(d): raise Exception('%s_doesnt_exist' % d)
+ except:
+ omni_lib = os.path.join(OMNI_ROOT, 'lib')
+ library_dirs += [ omni_lib ]
+
+
+ # Note for PyTango developers:
+ # Compilation time can be greatly reduced by compiling the file
+ # src/precompiled_header.hpp as src/precompiled_header.hpp.gch
+ # and then uncommenting this line. Someday maybe this will be
+ # automated...
+ extra_compile_args += [
+# '-includesrc/precompiled_header.hpp',
+ ]
+
+ #if not please_debug:
+ # extra_compile_args += [ '-g0' ]
+
+ extra_link_args += [
+ '-Wl,-h',
+ '-Wl,--strip-all',
+ ]
+
+ macros += []
+
+ include_dirs = uniquify(include_dirs)
+ library_dirs = uniquify(library_dirs)
+ src_dir = abspath('.')
+ _cppfiles = [ os.path.join(src_dir, fname) for fname in os.listdir(src_dir) if fname.endswith('.cpp') ]
+ _cppfiles.sort()
+ sources = ["Tango.sip"] + _cppfiles
+
+ cmdclass = {'build_ext': build_ext}
+
+ _tango = Extension(
+ name='Tango',
+ sources=sources,
+ include_dirs=include_dirs,
+ library_dirs=library_dirs,
+ libraries=libraries,
+ define_macros=macros,
+ extra_compile_args=extra_compile_args,
+ extra_link_args=extra_link_args,
+ language='c++',
+ depends=[])
+
+ dist = setup(
+ name='Tango',
+ version=Release.version,
+ description=Release.description,
+ long_description=Release.long_description,
+ author=author[0],
+ author_email=author[1],
+ url=Release.url,
+ download_url=Release.download_url,
+ platforms=Release.platform,
+ license=Release.license,
+ packages=packages,
+ package_dir={ 'Tango' : abspath(".") },
+ classifiers=classifiers,
+ provides=provides,
+ keywords=Release.keywords,
+ requires=requires,
+ ext_modules=[_tango],
+ cmdclass=cmdclass)
+
+if __name__ == "__main__":
+ main()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytango.git
More information about the debian-science-commits
mailing list