mailr24380 - /trunk/lib/structure/pdb_write.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on July 01, 2014 - 17:04:
Author: bugman
Date: Tue Jul  1 17:04:41 2014
New Revision: 24380

URL: http://svn.gna.org/viewcvs/relax?rev=24380&view=rev
Log:
Empty lines are now handled by the lib.structure.pdb_write.record() function.

By supplying the remark as None, empty lines can now be created in the REMARK 
section of a PDB file.
This can be used for nicer formatting.


Modified:
    trunk/lib/structure/pdb_write.py

Modified: trunk/lib/structure/pdb_write.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/structure/pdb_write.py?rev=24380&r1=24379&r2=24380&view=diff
==============================================================================
--- trunk/lib/structure/pdb_write.py    (original)
+++ trunk/lib/structure/pdb_write.py    Tue Jul  1 17:04:41 2014
@@ -1504,11 +1504,20 @@
     @type remark:       str
     """
 
+    # Initialise.
+    lines = []
+
+    # Handle empty lines.
+    if remark == None:
+        lines.append("%-6s %3s %-68s " % ("REMARK", num, ''))
+
     # The formatted record, splitting across lines if needed.
-    for line in wrap(remark, 68):
-        # The text.
-        text = "%-6s %3s %-68s " % ("REMARK", num, line.upper())
-
+    else:
+        for line in wrap(remark, 68):
+            lines.append("%-6s %3s %-68s " % ("REMARK", num, line.upper()))
+
+    # Output all lines.
+    for text in lines:
         # Validate.
         _record_validate(text)
 




Related Messages


Powered by MHonArc, Updated Tue Jul 01 17:20:02 2014