mailr6692 - /1.3/prompt/dasha.py


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

Header


Content

Posted by sebastien . morin . 1 on July 04, 2008 - 20:00:
Author: semor
Date: Fri Jul  4 20:00:09 2008
New Revision: 6692

URL: http://svn.gna.org/viewcvs/relax?rev=6692&view=rev
Log:
Conversion of force flags to bools.


Modified:
    1.3/prompt/dasha.py

Modified: 1.3/prompt/dasha.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/dasha.py?rev=6692&r1=6691&r2=6692&view=diff
==============================================================================
--- 1.3/prompt/dasha.py (original)
+++ 1.3/prompt/dasha.py Fri Jul  4 20:00:09 2008
@@ -41,7 +41,7 @@
         self.__relax__ = relax
 
 
-    def create(self, run=None, algor='LM', dir=None, force=0):
+    def create(self, run=None, algor='LM', dir=None, force=False):
         """Function for creating the Dasha script.
 
         Keyword Arguments
@@ -53,8 +53,8 @@
 
         dir:  The directory to place the files.  The default is the value of 
'run'.
 
-        force:  A flag which if set to 1 will cause the results file to be 
overwritten if it already
-        exists.
+        force:  A flag which if set to True will cause the results file to 
be overwritten if it
+        already exists.
 
 
         Description
@@ -99,14 +99,14 @@
                 raise RelaxNoneStrError, ('directory name', dir)
 
         # The force flag.
-        if type(force) != int or (force != 0 and force != 1):
-            raise RelaxBinError, ('force flag', force)
+        if type(force) != bool:
+            raise RelaxBoolError, ('force flag', force)
 
         # Execute the functional code.
         self.__relax__.generic.dasha.create(run=run, algor=algor, dir=dir, 
force=force)
 
 
-    def execute(self, run=None, dir=None, force=0, binary='dasha'):
+    def execute(self, run=None, dir=None, force=False, binary='dasha'):
         """Function for executing Dasha.
 
         Keyword Arguments
@@ -116,8 +116,8 @@
 
         dir:  The directory to place the files.  The default is the value of 
'run'.
 
-        force:  A flag which if set to 1 will cause the results file to be 
overwritten if it already
-        exists.
+        force:  A flag which if set to True will cause the results file to 
be overwritten if it
+        already exists.
 
         binary:  The name of the executable Dasha program file.
 
@@ -154,8 +154,8 @@
                 raise RelaxNoneStrError, ('directory name', dir)
 
         # The force flag.
-        if type(force) != int or (force != 0 and force != 1):
-            raise RelaxBinError, ('force flag', force)
+        if type(force) != bool:
+            raise RelaxBoolError, ('force flag', force)
 
         # The Dasha executable file.
         if type(binary) != str:




Related Messages


Powered by MHonArc, Updated Fri Jul 04 20:40:26 2008