diff --git a/src/sequenceParser/Sequence.hpp b/src/sequenceParser/Sequence.hpp index 4b3db0c..0c9cfe1 100644 --- a/src/sequenceParser/Sequence.hpp +++ b/src/sequenceParser/Sequence.hpp @@ -181,7 +181,6 @@ class Sequence EPattern checkPattern( const std::string& pattern, const EDetection detectionOptions ); -#ifndef SWIG bool operator<(const Sequence& other ) const { return getFilenameWithStandardPattern() < other.getFilenameWithStandardPattern(); @@ -201,7 +200,6 @@ class Sequence { return !operator==( other ); } -#endif /** * @brief Partial initialization, using only pattern informations. diff --git a/src/sequenceParser/Sequence.i b/src/sequenceParser/Sequence.i index 4bec4ab..c50809a 100644 --- a/src/sequenceParser/Sequence.i +++ b/src/sequenceParser/Sequence.i @@ -14,21 +14,20 @@ namespace std { %template(FrameRangeVector) vector< sequenceParser::FrameRange >; } -%include "Sequence.hpp" +#ifdef SWIGJAVA -#ifdef SWIGPYTHON - -%extend sequenceParser::Sequence -{ - %pythoncode - { - def __str__(self): - return self.string() - def __lt__(self, other): - return self.getFilenameWithStandardPattern() < other.getFilenameWithStandardPattern() - def __eq__(self, other): - return self._prefix == other._prefix and self._suffix == other._suffix and self._maxPadding == other._maxPadding and self._fixedPadding == other._fixedPadding and self._ranges == other._ranges - } -} +%rename (toString) sequenceParser::Sequence::string; +%rename (equals) sequenceParser::Sequence::operator==; +%ignore sequenceParser::Sequence::operator!=; +%ignore sequenceParser::Sequence::operator<; + +#elif SWIGPYTHON + +%rename(__str__) sequenceParser::Sequence::string; +%rename(__eq__) sequenceParser::Sequence::operator==; +%rename(__ne__) sequenceParser::Sequence::operator!=; +%rename(__lt__) sequenceParser::Sequence::operator<; #endif + +%include "Sequence.hpp"