mailr6700 - /branches/rdc_analysis/prompt/structure.py


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

Header


Content

Posted by edward on July 05, 2008 - 00:37:
Author: bugman
Date: Sat Jul  5 00:24:06 2008
New Revision: 6700

URL: http://svn.gna.org/viewcvs/relax?rev=6700&view=rev
Log:
Added the force arg to the structure.write_pdb() user function.


Modified:
    branches/rdc_analysis/prompt/structure.py

Modified: branches/rdc_analysis/prompt/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/prompt/structure.py?rev=6700&r1=6699&r2=6700&view=diff
==============================================================================
--- branches/rdc_analysis/prompt/structure.py (original)
+++ branches/rdc_analysis/prompt/structure.py Sat Jul  5 00:24:06 2008
@@ -450,7 +450,7 @@
         generic_fns.structure.main.vectors(proton=proton, spin_id=spin_id, 
verbosity=verbosity)
 
 
-    def write_pdb(self, file=None, dir=None, struct_index=None):
+    def write_pdb(self, file=None, dir=None, struct_index=None, force=False):
         """The PDB writing function.
 
         Keyword Arguments
@@ -462,7 +462,7 @@
 
         struct_index:  The index of the structure to write.
 
-        parser:  The PDB parser used to read the file.
+        force:  A flag which, if set to True, will overwrite the any 
pre-existing file.
 
 
         Description
@@ -494,7 +494,8 @@
             text = sys.ps3 + "structure.write_pdb("
             text = text + "file=" + `file`
             text = text + ", dir=" + `dir`
-            text = text + ", struct_index=" + `struct_index` + ")"
+            text = text + ", struct_index=" + `struct_index`
+            text = text + ", force=" + `force` + ")"
             print text
 
         # File name.
@@ -509,5 +510,9 @@
         if struct_index != None and type(struct_index) != int:
             raise RelaxNoneIntError, ('structure index', struct_index)
 
+        # The force flag.
+        if type(force) != bool:
+            raise RelaxBoolError, ('force flag', force)
+
         # Execute the functional code.
-        generic_fns.structure.main.write_pdb(file=file, dir=dir, 
struct_index=struct_index)
+        generic_fns.structure.main.write_pdb(file=file, dir=dir, 
struct_index=struct_index, force=force)




Related Messages


Powered by MHonArc, Updated Sat Jul 05 01:20:20 2008