PATCH: Remove minor code duplication
Mark Mitchell
mark at codesourcery.com
Fri Jun 10 21:00:05 UTC 2005
Since we have __CheckExtensionKind, we may as well use it.
--
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery.com
2005-06-10 Mark Mitchell <mark at codesourcery.com>
* qm/test/cmdline.py (QMTest.__ExecuteRegister): Use
__CheckExtensionKind.
Index: qm/test/cmdline.py
===================================================================
RCS file: /home/qm/Repository/qm/qm/test/cmdline.py,v
retrieving revision 1.105
diff -c -5 -p -r1.105 cmdline.py
*** qm/test/cmdline.py 31 May 2005 15:48:37 -0000 1.105
--- qm/test/cmdline.py 10 Jun 2005 20:57:27 -0000
*************** Valid formats are %s.
*** 1074,1087 ****
return 2
kind = self.__arguments[0]
class_name = self.__arguments[1]
# Check that the KIND is valid.
! if kind not in base.extension_kinds:
! raise qm.cmdline.CommandError, \
! qm.error("invalid extension kind",
! kind = kind)
# Check that the CLASS_NAME is well-formed.
if class_name.count('.') != 1:
raise qm.cmdline.CommandError, \
qm.error("invalid class name",
--- 1074,1084 ----
return 2
kind = self.__arguments[0]
class_name = self.__arguments[1]
# Check that the KIND is valid.
! self.__CheckExtensionKind(self, kind)
# Check that the CLASS_NAME is well-formed.
if class_name.count('.') != 1:
raise qm.cmdline.CommandError, \
qm.error("invalid class name",
More information about the qmtest
mailing list