X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdak.py;h=0f2280101858fd672b9c6649952a82201a1cf6ef;hb=30662a0d8af5ab5873ff7bdd7d59de52c1ce7fb5;hp=43da4dcb0861c3ab9a3dc76ca0b76958e25401c2;hpb=1ec6fce21325f5b3be284dd63981e6574e22d223;p=dak.git diff --git a/dak/dak.py b/dak/dak.py index 43da4dcb..0f228010 100755 --- a/dak/dak.py +++ b/dak/dak.py @@ -53,6 +53,26 @@ class UserExtension: ################################################################################ +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 + +################################################################################ + def init(): """Setup the list of modules and brief explanation of what they do.""" @@ -92,8 +112,8 @@ def init(): ("clean-proposed-updates", "Remove obsolete .changes from proposed-updates"), - ("edit-transitions", - "Edit the release transition file"), + ("transitions", + "Manage the release transition file"), ("check-overrides", "Override cruft checks"), ("check-proposed-updates",