Commit cfa613b8 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron
Browse files

* Removed CORE/ESPIA_VERSION dependency links from source tree:

  + addnewtags checks outdated dependency link (with git-archive)
    to detect Frelon/Maxipix updates with Espia not tested on new Core,
    LINK_STRICT_VERSION set (one level only) check type the (minor/release)
* Fixed bug where prepareAcq resets Frelon::LatencyTime sent by serial line:
  + Added SIP wrapping for std::map<int, std::string>
  + Exported RegStrMap & SerialLine::splitMsg to Python
  + Added FrelonAcq.checkMonitoredSerialCmd, which detects setting of
    LatencyTime, ShutCloseTime and ShutEnable and updates CtAcquisition and
    CtShutter so they are not lost on next prepareAcq if apply policy is All

Conflicts:

	camera/common/espia
	camera/maxipix
	common/VERSION
parent 448444ea
......@@ -105,7 +105,16 @@ class Version:
def __hash__(self):
return (self.major << 16) + ((self.minor or 0) << 8) + (self.rel or 0)
def effective(self, ver_ctrl):
if ver_ctrl == 'MAJOR':
return Version(self.major)
elif ver_ctrl == 'MINOR':
return Version(self.major, self.minor)
elif ver_ctrl == 'FULL':
return Version(self.major, self.minor, self.rel)
raise RuntimeError, 'Invalid ver_ctrl: %s' % ver_ctrl
mod_version_data = {
'core': 'common/VERSION',
'espia': 'camera/common/espia/VERSION',
......@@ -139,6 +148,7 @@ windows_plugins = ['pco', 'perkinelmer']
all_submodules = []
modified_submodules = []
base_mod_depend = {'espia': ['frelon', 'maxipix']}
dep_ver_ctrl = 'MINOR'
def mod_is_core_dependent(x):
excluded_mod = ['core'] + windows_plugins
......@@ -166,6 +176,21 @@ def get_all_submodules(base_dir=None):
raise RuntimeError, 'Cannot find submod rel_path: %s' % submod_dir
all_submodules.append(rel_path)
def read_config_inc():
global dep_ver_ctrl
config_inc = 'config.inc'
if not os.path.exists(config_inc):
return
f = open(config_inc)
for l in f.readlines():
sep = '='
if l.count(sep) == 1:
key, val = l.strip().split(sep)
if key == 'LINK_STRICT_VERSION':
dep_ver_ctrl = (int(val) and 'FULL') or 'MINOR'
def init_global_data(argv):
global base_path, os
......@@ -184,6 +209,7 @@ def init_global_data(argv):
base_path = os.getcwd()
os.chdir(base_path)
read_config_inc()
get_all_submodules()
base_mod_depend.update()
......@@ -192,13 +218,12 @@ def init_global_data(argv):
return args
def get_mod_version(mod, version_file_name):
if version_file_name is None:
version_file_name = mod_version_data[mod]
version_file = open(version_file_name, 'rt')
version_str = version_file.readlines()[0].strip()
version_file.close()
def get_mod_version(mod, version_file=None):
if version_file is None:
version_file = mod_version_data[mod]
if type(version_file) == str:
version_file = open(version_file, 'rt')
version_str = version_file.readline().strip()
return Version(fromstr=version_str)
def set_mod_version(mod, version_file_name, version):
......@@ -207,7 +232,42 @@ def set_mod_version(mod, version_file_name, version):
version_file.close()
mod_tag = get_git_tag(mod, version)
git_add_entry_to_commit(version_file_name, mod_tag)
def get_mod_version_at_commit(mod, commit):
ver_file_name = mod_version_data[mod]
mod_dir, rel_path = get_entry_submodule_path(ver_file_name)
old_dir = None
if mod_dir:
git_cmd = 'git ls-tree %s %s' % (commit, mod_dir)
obj = Popen(git_cmd, shell=True, stdout=PIPE)
out = obj.stdout.readline().strip()
commit = out.split()[2]
if obj.wait() != 0:
raise RuntimeError, 'Error reading git tree: %s' % git_cmd
old_dir = os.getcwd()
os.chdir(mod_dir)
try:
if not os.path.exists(rel_path):
raise IOError, 'Version file %s not available' % ver_file_name
git_cmd = 'git archive %s %s | tar -xOf -' % (commit, rel_path)
obj = Popen(git_cmd, shell=True, stdout=PIPE)
version = get_mod_version(mod, obj.stdout)
if obj.wait() != 0:
msg = ('commit=%s, mod_dir=%s, rel_path=%s' %
(commit, mod_dir, rel_path))
raise RuntimeError, 'Error extracting version file: ' + msg
finally:
if old_dir:
os.chdir(old_dir)
return version
def get_entry_submodule_path(entry):
for mod_dir in all_submodules:
rel_path = get_rel_path(entry, mod_dir)
if rel_path:
return mod_dir, rel_path
return None, get_rel_path(entry, base_path)
def depend_cmp(a, b):
table = {'core': -2, 'espia': -1}
a = table.get(a, 0)
......@@ -219,55 +279,57 @@ def get_depend_sorted_modules(modules):
modules.sort(depend_cmp)
return modules
def get_mod_dep_files(mod, modules):
mod_dep_files = {}
if mod not in base_mod_depend.keys():
return mod_dep_files
depend_list = base_mod_depend[mod]
bmod_ver_file_name = os.path.join('python', '%s_VERSION' % mod.upper())
for omod in depend_list:
if omod not in modules:
continue
omod_ver_file_name = mod_version_data[omod]
omod_dir = os.path.dirname(omod_ver_file_name)
bmod_ver_full_name = os.path.join(omod_dir, bmod_ver_file_name)
if not os.path.exists(bmod_ver_full_name):
raise RuntimeError, ('Cannot find %s version file for %s: %s' %
(mod, omod, bmod_ver_full_name))
mod_dep_files[omod] = bmod_ver_full_name
return mod_dep_files
def check_unmodif_mod_dep_files(modules):
for mod in base_mod_depend.keys():
if mod in modules:
def check_outdated_mod_dep_versions(mod_version_objs):
unmodif_deps = {}
for mod in mod_version_objs:
for bmod, dmods in base_mod_depend.items():
if bmod in mod_version_objs or mod not in dmods:
continue
for bbmod, bdmods in base_mod_depend.items():
if bmod in bdmods:
if bmod not in unmodif_deps:
unmodif_deps[bmod] = bbmod, []
unmodif_deps[bmod][1].append(mod)
break
for mod, mod_data in unmodif_deps.items():
bmod, dep_mods = mod_data
try:
try:
bversion = mod_version_objs[bmod]
except:
bversion = get_mod_version(bmod)
mversion = get_mod_version(mod)
tag = '%s-%s' % (mod, mversion)
oversion = get_mod_version_at_commit(bmod, tag)
except IOError:
print 'Error: cannot find version for modules %s, %s' % (bmod, mod)
print '+ Please do git submodule init/update first'
sys.exit(1)
eoversion = oversion.effective(dep_ver_ctrl)
ebversion = bversion.effective(dep_ver_ctrl)
if eoversion == ebversion:
continue
try:
version = get_mod_version(mod, None)
except IOError:
continue
mod_dep_files = get_mod_dep_files(mod, modules)
for omod, dep_file in mod_dep_files.items():
oversion = get_mod_version(mod, dep_file)
if oversion != version:
print 'Error: outdated %s [%s] dependency link on ' \
'submodule %s [%s]' % (mod, version, omod, oversion)
print 'To solve this you should:'
print '+ Compile your module (COMPILE_%s=1):' % omod.upper()
print ' "make config && make && make -C sip && make install"'
print '+ Validate it'
print '+ Update submodule dependency:'
print ' "git add %s"' % dep_file
sys.exit(1)
new_tag = '%s-%s' % (bmod, bversion)
print 'Error: outdated %s dependency link on submodule %s ' % \
(bmod, mod)
print ' [needed by %s]' % ', '.join(dep_mods)
print '+ %s %s version is %s, current is %s' % \
(tag, bmod, oversion, new_tag)
print 'To solve this you should:'
print '+ Validate the %s module with %s' % (mod, new_tag)
print '+ Add %s to the list of modules to tag' % mod
sys.exit(1)
def git_add_entry_to_commit(entry, mod_tag):
old_dir = os.getcwd()
for mod_dir in all_submodules:
rel_path = get_rel_path(entry, mod_dir)
if not rel_path:
continue
mod_dir, rel_path = get_entry_submodule_path(entry)
if not mod_dir:
# file in core tree
if os.system('git add %s' % rel_path) != 0:
print 'Error adding %s' % rel_path
sys.exit(1)
else:
# add in submodule
old_dir = os.getcwd()
os.chdir(mod_dir)
if os.system('git add %s' % rel_path) != 0:
print 'Error adding %s [%s,%s]' % (entry, mod_dir, rel_path)
......@@ -282,14 +344,7 @@ def git_add_entry_to_commit(entry, mod_tag):
break
if not in_modified_list:
modified_submodules.append([mod_dir, [mod_tag]])
return
# file in core tree
rel_path = get_rel_path(entry, base_path)
if os.system('git add %s' % rel_path) != 0:
print 'Error adding %s' % rel_path
sys.exit(1)
def git_commit_submodules():
old_dir = os.getcwd()
......@@ -349,23 +404,20 @@ def main(argv):
mod_version_objs = {}
for mod in modules:
try:
version = get_mod_version(mod, None)
version = get_mod_version(mod)
except IOError:
continue
if change_type == JUST_PRINT:
continue
print 'Error: trying to tag a module not checked-out: %s' % mod
print '+ Please do git submodule init/update first'
sys.exit(1)
mod_version_objs[mod] = version
print 'Found %-*s version: %s' % (max_name_len, mod, version)
if change_type == JUST_PRINT:
sys.exit(0)
# Checks before performing git actions, just in case of error
check_unmodif_mod_dep_files(modules)
mod_dep_files = {}
for mod in modules:
mod_dep_files[mod] = get_mod_dep_files(mod, modules)
for mod in modules:
version = mod_version_objs[mod]
for mod, version in mod_version_objs.items():
if change_type == CHG_MAJOR:
version.major += 1
version.minor = 0
......@@ -376,21 +428,22 @@ def main(argv):
elif change_type == CHG_RELEASE:
version.rel += 1
print '+ New %-*s version: %s' % (max_name_len, mod, version)
# Check deps before performing any action, just in case of error
check_outdated_mod_dep_versions(mod_version_objs)
# Now can start changes
for mod, version in mod_version_objs.items():
mod_ver_file = mod_version_data[mod]
set_mod_version(mod, mod_ver_file, version)
for omod, dep_file in mod_dep_files[mod].items():
set_mod_version(mod, dep_file, version)
git_commit_submodules()
if os.system('git commit') != 0:
print 'Error in core tree commit'
sys.exit(1)
for mod in modules:
version = mod_version_objs[mod]
for mod, version in mod_version_objs.items():
git_tag = get_git_tag(mod, version)
print 'Creating git tag: %s' % git_tag
......
adsc @ 81640cf2
Subproject commit 5c1c6a4371f0b0bf5553763c3be5f44bcab37701
Subproject commit 81640cf25b8fb3dc1afe4e76b52485b049a94654
andor @ ebf07003
Subproject commit 960fb2f819c53a193b48c046da34f48d0a555609
Subproject commit ebf07003627c450752b16654435a47de400b4004
basler @ c791fe4d
Subproject commit b8fd267cb1c941b1db8951208ae9944adbc18552
Subproject commit c791fe4dd44b628ac750cbc38b86f7178a258b43
espia @ 7254a9ed
Subproject commit 366dfc9e8119c3cf1718cf81cd32fe89305bbf79
Subproject commit 7254a9edc9cc53cc6817e303c4ee7aa193395fb9
frelon @ 75f0a9a6
Subproject commit 9289e83ded03168c9f67873845c9dc985a8d3354
Subproject commit 75f0a9a6c710f3fa7ca7f456786539989714bd1b
maxipix @ bc2040c8
Subproject commit 18fcc67425c0fbad7086474e64c88e24c90e8796
Subproject commit bc2040c816985ad576a1d65276b645d62babcfdd
mythen @ 1f7920ee
Subproject commit 6e6395ba9520e14ffcf7e335981873642ec96dca
Subproject commit 1f7920ee154adcf56f93c454922e1c8b8cfa8f6d
pilatus @ 77a68b5b
Subproject commit 75f59801dcb0b95ca208fadf08eab7a2ba96ce79
Subproject commit 77a68b5b49acc3c7eaf3ca4f3b9bece404895081
prosilica @ 554d007f
Subproject commit b02ea1fe508bcb54a66db7ee46276a2ef5ac750b
Subproject commit 554d007ff2204ab63b3aa9e39fa9e483c22ca39f
roperscientific @ 69b0bf2c
Subproject commit 812f263025a2b1ee89a72bdaebafcb29c020aff1
Subproject commit 69b0bf2c2d53f142ab02dc57b06bb4d9c90fcdb0
ueye @ 8d163332
Subproject commit 38c0597d4b93701d793b12c11cce406053f64b4c
Subproject commit 8d163332e8de7e00e7338cd9828a6ad0fac864df
xpad @ 4f998444
Subproject commit d30a5273c9bc18fa63002b9ad9f486e2aa4cf324
Subproject commit 4f9984446624d38445a2efec20772bc52a272bdb
......@@ -61,12 +61,7 @@ GLOB_PYTHON_ENV = \(os.environ\['LIMA_LINK_STRICT_VERSION'\][ \t]*=[ \t]*\)
GLOB_PYTHON_INIT_SED = "s/$(GLOB_PYTHON_ENV)'[A-Z]\+'/\1$(ENV_LINK_STRICT_VER)/"
CORE_VERSION_NAME = common/VERSION
install_core_dep = \
(diff $(CORE_VERSION_NAME) $(1)/python/CORE_VERSION > /dev/null 2>&1 || \
(echo "* Manually updating $(1)/python/CORE_VERSION from" \
"$(CORE_VERSION_NAME)" && \
cp $(CORE_VERSION_NAME) $(1)/python/CORE_VERSION)) && \
cp $(1)/python/CORE_VERSION $(2)
install_core_dep = cp $(CORE_VERSION_NAME) $(1)/CORE_VERSION
ifneq ($(COMPILE_CORE), 0)
INSTALL_CORE_DIR = $(INSTALL_PLAT_DIR)/Core
......@@ -81,12 +76,7 @@ INSTALL_SIMU_VDIR = $(INSTALL_SIMU_DIR)/v$(SIMU_FULL_VERSION)
endif
ESPIA_VERSION_NAME = camera/common/espia/VERSION
install_espia_dep = \
(diff $(ESPIA_VERSION_NAME) $(1)/python/ESPIA_VERSION > /dev/null 2>&1 || \
(echo "* Manually updating $(1)/python/ESPIA_VERSION from" \
"$(ESPIA_VERSION_NAME)" && \
cp $(ESPIA_VERSION_NAME) $(1)/python/ESPIA_VERSION)) && \
cp $(1)/python/ESPIA_VERSION $(2)
install_espia_dep = cp $(ESPIA_VERSION_NAME) $(1)/ESPIA_VERSION
ifneq ($(COMPILE_ESPIA), 0)
INSTALL_ESPIA_DIR = $(INSTALL_PLAT_DIR)/Espia
......@@ -235,7 +225,7 @@ endif
ifneq ($(COMPILE_SIMULATOR), 0)
mkdir -p $(INSTALL_SIMU_VDIR)
cp camera/simulator/python/__init__.py $(INSTALL_SIMU_DIR)
$(call install_core_dep,camera/simulator,$(INSTALL_SIMU_VDIR))
$(call install_core_dep,$(INSTALL_SIMU_VDIR))
rm -rf $(INSTALL_LIB_DIR)/liblimasimulator.so*
cp -d build/liblimasimulator.so* $(INSTALL_LIB_DIR)
cp sip/simulator/limasimulator.so $(INSTALL_SIMU_VDIR)
......@@ -244,7 +234,7 @@ endif
ifneq ($(COMPILE_ESPIA), 0)
mkdir -p $(INSTALL_ESPIA_VDIR)
cp camera/common/espia/python/__init__.py $(INSTALL_ESPIA_DIR)
$(call install_core_dep,camera/common/espia,$(INSTALL_ESPIA_VDIR))
$(call install_core_dep,$(INSTALL_ESPIA_VDIR))
rm -rf $(INSTALL_LIB_DIR)/liblimaespia.so*
cp -d build/liblimaespia.so* $(INSTALL_LIB_DIR)
cp sip/espia/limaespia.so $(INSTALL_ESPIA_VDIR)
......@@ -253,7 +243,7 @@ endif
ifneq ($(COMPILE_FRELON), 0)
mkdir -p $(INSTALL_FRELON_VDIR)
cp camera/frelon/python/__init__.py $(INSTALL_FRELON_DIR)
$(call install_espia_dep,camera/frelon,$(INSTALL_FRELON_VDIR))
$(call install_espia_dep,$(INSTALL_FRELON_VDIR))
rm -rf $(INSTALL_LIB_DIR)/liblimafrelon.so*
cp -d build/liblimafrelon.so* $(INSTALL_LIB_DIR)
cp sip/frelon/limafrelon.so $(INSTALL_FRELON_VDIR)
......@@ -263,7 +253,7 @@ endif
ifneq ($(COMPILE_MAXIPIX), 0)
mkdir -p $(INSTALL_MAXIPIX_VDIR)
cp camera/maxipix/python/__init__.py $(INSTALL_MAXIPIX_DIR)
$(call install_espia_dep,camera/maxipix,$(INSTALL_MAXIPIX_VDIR))
$(call install_espia_dep,$(INSTALL_MAXIPIX_VDIR))
rm -rf $(INSTALL_LIB_DIR)/liblimamaxipix.so*
cp -d build/liblimamaxipix.so* $(INSTALL_LIB_DIR)
cp sip/maxipix/limamaxipix.so $(INSTALL_MAXIPIX_VDIR)
......@@ -273,14 +263,14 @@ endif
ifneq ($(COMPILE_PILATUS), 0)
mkdir -p $(INSTALL_PILATUS_VDIR)
cp camera/pilatus/python/__init__.py $(INSTALL_PILATUS_DIR)
$(call install_core_dep,camera/pilatus,$(INSTALL_PILATUS_VDIR))
$(call install_core_dep,$(INSTALL_PILATUS_VDIR))
cp camera/pilatus/python/*.py $(INSTALL_PILATUS_VDIR)
cp camera/pilatus/include/*.h $(INSTALL_INCLUDE_DIR)
endif
ifneq ($(COMPILE_BASLER), 0)
mkdir -p $(INSTALL_BASLER_VDIR)
cp camera/basler/python/__init__.py $(INSTALL_BASLER_DIR)
$(call install_core_dep,camera/basler,$(INSTALL_BASLER_VDIR))
$(call install_core_dep,$(INSTALL_BASLER_VDIR))
rm -rf $(INSTALL_LIB_DIR)/liblimabasler.so*
cp -d build/liblimabasler.so* $(INSTALL_LIB_DIR)
cp sip/basler/limabasler.so $(INSTALL_BASLER_VDIR)
......@@ -289,7 +279,7 @@ endif
ifneq ($(COMPILE_PROSILICA), 0)
mkdir -p $(INSTALL_PROSILICA_VDIR)
cp camera/prosilica/python/__init__.py $(INSTALL_PROSILICA_DIR)
$(call install_core_dep,camera/prosilica,$(INSTALL_PROSILICA_VDIR))
$(call install_core_dep,$(INSTALL_PROSILICA_VDIR))
rm -rf $(INSTALL_LIB_DIR)/liblimaprosilica.so*
rm -rf $(INSTALL_LIB_DIR)/libPvAPI.so
cp -d build/liblimaprosilica.so* $(INSTALL_LIB_DIR)
......@@ -313,7 +303,7 @@ endif
ifneq ($(COMPILE_ROPERSCIENTIFIC), 0)
mkdir -p $(INSTALL_ROPERSCIENTIFIC_VDIR)
cp camera/roperscientific/python/__init__.py $(INSTALL_ROPERSCIENTIFIC_DIR)
$(call install_core_dep,camera/roperscientific,$(INSTALL_ROPERSCIENTIFIC_VDIR))
$(call install_core_dep,$(INSTALL_ROPERSCIENTIFIC_VDIR))
rm -rf $(INSTALL_LIB_DIR)/liblimaroperscientific.so*
cp -d build/liblimaroperscientific.so* $(INSTALL_LIB_DIR)
cp sip/roperscientific/limaroperscientific.so $(INSTALL_ROPERSCIENTIFIC_VDIR)
......@@ -323,7 +313,7 @@ endif
ifneq ($(COMPILE_ADSC), 0)
mkdir -p $(INSTALL_ADSC_VDIR)
cp camera/adsc/python/__init__.py $(INSTALL_ADSC_DIR)
$(call install_core_dep,camera/adsc,$(INSTALL_ADSC_VDIR))
$(call install_core_dep,$(INSTALL_ADSC_VDIR))
rm -rf $(INSTALL_LIB_DIR)/liblimaadsc.so*
cp -d build/liblimaadsc.so* $(INSTALL_LIB_DIR)
cp sip/adsc/limaadsc.so $(INSTALL_ADSC_VDIR)
......@@ -335,7 +325,7 @@ endif
ifneq ($(COMPILE_MYTHEN), 0)
mkdir -p $(INSTALL_MYTHEN_VDIR)
cp camera/mythen/python/__init__.py $(INSTALL_MYTHEN_DIR)
$(call install_core_dep,camera/mythen,$(INSTALL_MYTHEN_VDIR))
$(call install_core_dep,$(INSTALL_MYTHEN_VDIR))
rm -rf $(INSTALL_LIB_DIR)/liblimamythen.so*
cp -d build/liblimamythen.so* $(INSTALL_LIB_DIR)
cp sip/mythen/limamythen.so $(INSTALL_MYTHEN_VDIR)
......@@ -345,7 +335,7 @@ endif
ifneq ($(COMPILE_UEYE), 0)
mkdir -p $(INSTALL_UEYE_VDIR)
cp camera/ueye/python/__init__.py $(INSTALL_UEYE_DIR)
$(call install_core_dep,camera/ueye,$(INSTALL_UEYE_VDIR))
$(call install_core_dep,$(INSTALL_UEYE_VDIR))
cp camera/ueye/python/CORE_VERSION
rm -rf $(INSTALL_LIB_DIR)/liblimaueye.so*
cp -d build/liblimaueye.so* $(INSTALL_LIB_DIR)
......@@ -355,7 +345,7 @@ endif
ifneq ($(COMPILE_ANDOR), 0)
mkdir -p $(INSTALL_ANDOR_VDIR)
cp camera/andor/python/__init__.py $(INSTALL_ANDOR_DIR)
$(call install_core_dep,camera/andor,$(INSTALL_ANDOR_VDIR))
$(call install_core_dep,$(INSTALL_ANDOR_VDIR))
rm -rf $(INSTALL_LIB_DIR)/liblimaandor.so*
cp -d build/liblimaandor.so* $(INSTALL_LIB_DIR)
cp sip/andor/limaandor.so $(INSTALL_ANDOR_VDIR)
......@@ -365,7 +355,7 @@ endif
ifneq ($(COMPILE_XPAD), 0)
mkdir -p $(INSTALL_XPAD_VDIR)
cp camera/xpad/python/__init__.py $(INSTALL_XPAD_DIR)
$(call install_core_dep,camera/xpad,$(INSTALL_XPAD_VDIR))
$(call install_core_dep,$(INSTALL_XPAD_VDIR))
rm -rf $(INSTALL_LIB_DIR)/liblimaxpad.so*
cp -d build/liblimaxpad.so* $(INSTALL_LIB_DIR)
cp sip/xpad/limaxpad.so $(INSTALL_XPAD_VDIR)
......
......@@ -213,6 +213,56 @@ return aReturnListPt;
%End
};
%MappedType std::map<int,std::string>
{
%TypeHeaderCode
#include <map>
#include <string>
%End
%ConvertToTypeCode
PyObject *key, *value;
SIP_SSIZE_T pos;
if(sipIsErr == NULL)
{
bool aReturnFlag = PyDict_Check(sipPy);
pos = 0;
while(aReturnFlag && PyDict_Next(sipPy, &pos, &key, &value))
aReturnFlag = PyInt_Check(key) && PyString_Check(value);
return aReturnFlag;
}
*sipCppPtr = new std::map<int,std::string>();
pos = 0;
while(PyDict_Next(sipPy, &pos, &key, &value))
{
int anIndex = PyInt_AS_LONG(key);
char *s = PyString_AsString(value);
std::pair<int,std::string> item(anIndex,s);
(*sipCppPtr)->insert(item);
}
return sipGetState(sipTransferObj);
%End
%ConvertFromTypeCode
PyObject* aReturnDictPt = PyDict_New();
std::map<int,std::string>::iterator mIter, mEnd = sipCpp->end();
for(mIter = sipCpp->begin(); mIter != mEnd; ++mIter)
{
PyObject *aKeyPt = PyInt_FromLong(mIter->first);
std::string *sPt = &mIter->second;
PyObject *aValuePt = PyString_FromStringAndSize(sPt->data(),sPt->length());
PyDict_SetItem(aReturnDictPt,aKeyPt,aValuePt);
Py_DECREF(aKeyPt);Py_DECREF(aValuePt);
}
return aReturnDictPt;
%End
};
%MappedType std::map<int,std::list<std::string>>
{
%TypeHeaderCode
......
Supports Markdown
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