mailr7839 - /branches/multi_processor_merge/multi/processor.py


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

Header


Content

Posted by edward on October 19, 2008 - 19:10:
Author: bugman
Date: Sun Oct 19 19:10:52 2008
New Revision: 7839

URL: http://svn.gna.org/viewcvs/relax?rev=7839&view=rev
Log:
Added error checking for the processor type passed in with the -m command 
line argument.


Modified:
    branches/multi_processor_merge/multi/processor.py

Modified: branches/multi_processor_merge/multi/processor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_processor_merge/multi/processor.py?rev=7839&r1=7838&r2=7839&view=diff
==============================================================================
--- branches/multi_processor_merge/multi/processor.py (original)
+++ branches/multi_processor_merge/multi/processor.py Sun Oct 19 19:10:52 2008
@@ -104,9 +104,14 @@
 
 #FIXME: better requirement of inherited commands.
 #TODO: check exceptions on master.
+
+# Python module imports.
 import time, datetime, math, sys, os
 import traceback, textwrap
+
+# relax module imports.
 from multi.prependStringIO import PrependStringIO, PrependOut
+from relax_errors import RelaxError
 
 
 def import_module(module_path, verbose=False):
@@ -163,6 +168,10 @@
     @return:                A loaded processor object or None to indicate 
failure.
     @rtype:                 multi.processor.Processor instance
     '''
+
+    # Check that the processor type is supported.
+    if processor_name not in ['uni', 'multi']:
+        raise RelaxError, "The processor type '%s' is not supported." % 
processor_name
 
     # The Processor details.
     processor_name = processor_name + '_processor'




Related Messages


Powered by MHonArc, Updated Sun Oct 19 20:20:06 2008