From 95d23764c3df72df3b7cd8e8efa145662408934c Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Fri, 10 Aug 2012 11:39:30 +0200 Subject: [PATCH] [entropy.db.skel] move SETTING_KEYS and add ModuleProxy to EntropyRepositoryBase --- lib/entropy/db/skel.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/entropy/db/skel.py b/lib/entropy/db/skel.py index 4b81655cf..30c3de6a3 100644 --- a/lib/entropy/db/skel.py +++ b/lib/entropy/db/skel.py @@ -364,6 +364,32 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore): """ VIRTUAL_META_PACKAGE_CATEGORY = "virtual" + # You can extend this with custom settings for your Repository + SETTING_KEYS = ("arch", "schema_revision") + + class ModuleProxy: + + @staticmethod + def get(): + """ + Lazily load the Repository module. + """ + raise NotImplementedError() + + @staticmethod + def exceptions(): + """ + Get the Repository exceptions module. + """ + raise NotImplementedError() + + @staticmethod + def errno(): + """ + Get the Repository errno module. + """ + raise NotImplementedError() + def __init__(self, readonly, xcache, temporary, name): """ @@ -3694,7 +3720,7 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore): """ Return stored Repository setting. For currently supported setting_name values look at - EntropyRepository._SETTING_KEYS. + EntropyRepository.SETTING_KEYS. @param setting_name: name of repository setting @type setting_name: string