| 58 | |
| 59 | template<class T> |
| 60 | std::string repr( T &x ) |
| 61 | { |
| 62 | std::stringstream s; |
| 63 | |
| 64 | s << "IECore." << x.typeName() << "( "; |
| 65 | |
| 66 | object item( x.readable() ); |
| 67 | |
| 68 | assert( item.attr( "__repr__" ) != object() ); |
| 69 | |
| 70 | s << call_method< std::string >( item.ptr(), "__repr__" ); |
| 71 | |
| 72 | s << " )"; |
| 73 | |
| 74 | return s.str(); |
| 75 | } |
| 76 | |
| 77 | template<class T> |
| 78 | static void setValue( T &that, const typename T::ValueType &v ) |