ftpmaster-dak r1084: Merge from cleanup branch
------------------------------------------------------------
revno: 1084
committer: Joerg Jaspert <joerg@debian.org>
branch nick: upstream
timestamp: Mon 2008-05-05 16:16:17 +0200
message:
Merge from cleanup branch
modified:
ChangeLog
dak/transitions.py
daklib/dak_exceptions.py
------------------------------------------------------------
revno: 1082.1.7
committer: Joerg Jaspert <joerg@debian.org>
branch nick: cleanup
timestamp: Mon 2008-05-05 16:16:03 +0200
message:
Move the transitions exception into our own class too and use it
modified:
ChangeLog
dak/transitions.py
daklib/dak_exceptions.py
=== modified file 'ChangeLog'
--- a/ChangeLog 2008-05-05 13:54:03 +0000
+++ b/ChangeLog 2008-05-05 14:16:03 +0000
@@ -1,3 +1,8 @@
+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
=== modified file 'dak/transitions.py'
--- a/dak/transitions.py 2008-05-04 00:34:14 +0000
+++ b/dak/transitions.py 2008-05-05 14:16:03 +0000
@@ -27,6 +27,7 @@
import apt_pkg
import daklib.database as database
import daklib.utils as utils
+from daklib.dak_extensions import TransitionsError
import syck
# Globals
@@ -227,9 +228,6 @@
################################################################################
-class ParseException(Exception):
- pass
-
##########################################
#### This usually runs within sudo !! ####
##########################################
@@ -248,7 +246,7 @@
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)
################################################################################
@@ -458,7 +456,7 @@
if Options["import"]:
try:
write_transitions_from_file(Options["import"])
- except ParseException, m:
+ except TransitionsError, m:
print m
sys.exit(2)
sys.exit(0)
=== modified file 'daklib/dak_exceptions.py'
--- a/daklib/dak_exceptions.py 2008-05-05 13:54:03 +0000
+++ b/daklib/dak_exceptions.py 2008-05-05 14:16:03 +0000
@@ -44,13 +44,13 @@
"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
Reply to: