#!/usr/bin/env python
-# Display, edit and check the release manager's transition file.
+""" Display, edit and check the release manager's transition file. """
# Copyright (C) 2008 Joerg Jaspert <joerg@debian.org>
# This program is free software; you can redistribute it and/or modify
################################################################################
-import os, pg, sys, time, errno, fcntl, tempfile, pwd, re
+import os, pg, sys, time, errno, fcntl, tempfile, pwd
import apt_pkg
from daklib import database
from daklib import utils
from daklib.dak_exceptions import TransitionsError
-import syck
+from daklib.regexes import re_broken_package
+import yaml
# Globals
Cnf = None
Options = None
projectB = None
-re_broken_package = re.compile(r"[a-zA-Z]\w+\s+\-.*")
-
################################################################################
#####################################
sourcecontent = sourcefile.read()
failure = False
try:
- trans = syck.load(sourcecontent)
- except syck.error, msg:
+ trans = yaml.load(sourcecontent)
+ except yaml.YAMLError, exc:
# Someone fucked it up
- print "ERROR: %s" % (msg)
+ print "ERROR: %s" % (exc)
return None
# lets do further validation here
temp_lock = lock_file(trans_temp)
destfile = file(trans_temp, 'w')
- syck.dump(from_trans, destfile)
+ yaml.dump(from_trans, destfile, default_flow_style=False)
destfile.close()
os.rename(trans_temp, trans_file)
(fd, path) = tempfile.mkstemp("", "transitions", Cnf["Transitions::TempPath"])
os.chmod(path, 0644)
f = open(path, "w")
- syck.dump(transitions, f)
+ yaml.dump(transitions, f, default_flow_style=False)
return path
################################################################################