Commit b6ac0bdb9cb4c0296ba67bd2f610d243b1f76969
1 parent
cbf9c1dd
GFilename.__add__ operators return now a string instead of GFilename.
Showing
1 changed file
with
7 additions
and
4 deletions
pyext/GFilename.i
| @@ -72,11 +72,14 @@ public: | @@ -72,11 +72,14 @@ public: | ||
| 72 | * @brief GFilename class extension | 72 | * @brief GFilename class extension |
| 73 | ***************************************************************************/ | 73 | ***************************************************************************/ |
| 74 | %extend GFilename { | 74 | %extend GFilename { |
| 75 | - GFilename __add__(const std::string& string) const { | ||
| 76 | - return ((*self) + string); | 75 | + std::string __repr__(void) const { |
| 76 | + return (std::string(*self)); | ||
| 77 | } | 77 | } |
| 78 | - GFilename __radd__(const std::string& string) const { | ||
| 79 | - return (string + (*self)); | 78 | + std::string __add__(const std::string& string) const { |
| 79 | + return (std::string(*self) + string); | ||
| 80 | + } | ||
| 81 | + std::string __radd__(const std::string& string) const { | ||
| 82 | + return (string + std::string(*self)); | ||
| 80 | } | 83 | } |
| 81 | bool __eq__(const GFilename& filename) const { | 84 | bool __eq__(const GFilename& filename) const { |
| 82 | return ((*self) == filename); | 85 | return ((*self) == filename); |