X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=dak%2Fdak.py;fp=dak%2Fdak.py;h=0f2280101858fd672b9c6649952a82201a1cf6ef;hb=2764c503d2f9c2177873f861c9dad76bcd2c04ca;hp=10da0411b2a4e658e9141b07cd13fea9228ac383;hpb=dd49639fb04f8f5be2a56516f79e0168f684e905;p=dak.git diff --git a/dak/dak.py b/dak/dak.py index 10da0411..0f228010 100755 --- a/dak/dak.py +++ b/dak/dak.py @@ -29,7 +29,27 @@ ################################################################################ import sys, imp -import daklib.utils +import daklib.utils, daklib.extensions + +################################################################################ + +class UserExtension: + def __init__(self, user_extension = None): + if user_extension: + m = imp.load_source("dak_userext", user_extension) + d = m.__dict__ + else: + m, d = None, {} + self.__dict__["_module"] = m + self.__dict__["_d"] = d + + def __getattr__(self, a): + if a in self.__dict__: return self.__dict__[a] + if a[0] == "_": raise AttributeError, a + return self._d.get(a, None) + + def __setattr__(self, a, v): + self._d[a] = v ################################################################################ @@ -91,7 +111,9 @@ def init(): "Clean cruft from incoming"), ("clean-proposed-updates", "Remove obsolete .changes from proposed-updates"), - + + ("transitions", + "Manage the release transition file"), ("check-overrides", "Override cruft checks"), ("check-proposed-updates", @@ -209,6 +231,8 @@ def main(): module.dak_userext = userext userext.dak_module = module + + daklib.extensions.init(cmdname, module, userext) if userext.init is not None: userext.init(cmdname) module.main()