python: add get_name & set_name for automata

* wrap/python/spot_impl.i (get_name, set_name): New methods for twa.
* wrap/python/tests/remfin.py: Test them.
* wrap/python/ajax/spotcgi.in: Use set_name().
* NEWS: Mention it.
This commit is contained in:
Alexandre Duret-Lutz 2015-10-18 15:43:19 +02:00
parent 176c9e2e17
commit 43a5187ab4
4 changed files with 26 additions and 0 deletions

View file

@ -187,6 +187,13 @@ using namespace spot;
$result = SWIG_NewPointerObj(new spot::formula($1), $descriptor(spot::formula*), SWIG_POINTER_OWN);
}
%typemap(out) std::string* {
if (!$1)
$result = SWIG_Py_Void();
else
$result = SWIG_FromCharPtr($1->c_str());
}
%exception {
try {
$action
@ -330,6 +337,18 @@ namespace std {
std::string __str__() { return spot::str_psl(*self); }
}
%extend spot::twa {
void set_name(std::string name)
{
self->set_named_prop("automaton-name", new std::string(name));
}
std::string* get_name()
{
return self->get_named_prop<std::string>("automaton-name");
}
}
%extend spot::acc_cond::acc_code {
std::string __repr__()
{