From 61c1f3ffc3cf3991216a43a7ddb50f2676497182 Mon Sep 17 00:00:00 2001
From: marco <marco@5a81b35b-ba03-0410-adc8-b2c5c5119f08>
Date: Thu, 29 Apr 2010 11:35:37 +0000
Subject: [PATCH] export __str__ for SecStructure

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2135 5a81b35b-ba03-0410-adc8-b2c5c5119f08
---
 modules/mol/base/pymod/export_residue.cc | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/mol/base/pymod/export_residue.cc b/modules/mol/base/pymod/export_residue.cc
index 688f81be8..905c6b515 100644
--- a/modules/mol/base/pymod/export_residue.cc
+++ b/modules/mol/base/pymod/export_residue.cc
@@ -29,6 +29,13 @@ using namespace ost::mol;
 #include <ost/export_helper/generic_property_def.hh>
 
 namespace {
+  
+  
+  String sec_structure_as_string(SecStructure& s)
+  {
+    return String(1, char(s));
+  }
+
   typedef EntityView (ResidueHandle::*QueryMethod)(const Query&, uint) const;
   typedef EntityView (ResidueHandle::*StringMethod)(const String&, uint) const;
   QueryMethod select_query=&ResidueHandle::Select;
@@ -70,7 +77,8 @@ void export_Residue()
       .def(init<SecStructure::Type>())
       .def("IsHelical", &SecStructure::IsHelical)
       .def("IsExtended", &SecStructure::IsExtended)
-      .def("IsCoil", &SecStructure::IsCoil)        
+      .def("IsCoil", &SecStructure::IsCoil)
+      .def("__str__", &sec_structure_as_string)
     ;
     enum_<SecStructure::Type>("Type")
       .value("EXTENDED", SecStructure::EXTENDED)
-- 
GitLab