+2008-05-05 Joerg Jaspert <joerg@debian.org>
+
+ * daklib/dak_exceptions.py (dakerrors): add TransitionsError
+ * dak/transitions.py: Use it, instead of the own definition
+
2008-05-05 Mark Hymers <mhy@debian.org>
* daklib/dak_exceptions.py: Add a default message and tidy up our string
import apt_pkg
import daklib.database as database
import daklib.utils as utils
+from daklib.dak_extensions import TransitionsError
import syck
# Globals
################################################################################
-class ParseException(Exception):
- pass
-
##########################################
#### This usually runs within sudo !! ####
##########################################
else:
trans = load_transitions(from_file)
if trans is None:
- raise ParseException, "Unparsable transitions file %s" % (file)
+ raise TransitionsError, "Unparsable transitions file %s" % (file)
write_transitions(trans)
################################################################################
if Options["import"]:
try:
write_transitions_from_file(Options["import"])
- except ParseException, m:
+ except TransitionsError, m:
print m
sys.exit(2)
sys.exit(0)
"UnknownFormatError": """Exception raised for unknown Format: lines in changes files.""",
"NoFilesFieldError": """Exception raised for missing files field in dsc/changes.""",
"CantOpenError": """Exception raised when files can't be opened.""",
- "CantOverwriteError": """Exception raised when files cant be overwritten.""",
+ "CantOverwriteError": """Exception raised when files can't be overwritten.""",
"FileExistsError": """Exception raised when destination file exists.""",
"SendmailFailedError": """Exception raised when Sendmail invocation failed.""",
- "NoFreeFilenameError": """Exception raised when no alternate filename was found."""
+ "NoFreeFilenameError": """Exception raised when no alternate filename was found.""",
+ "TransitionsError": """Exception raised when transitions file can't be parsed."""
}
-
def construct_dak_exception(name, description):
class Er(DakError):
__doc__ = description