summaryrefslogtreecommitdiff
path: root/portato/backend/package.py
diff options
context:
space:
mode:
authornecoro <>2007-03-10 22:59:52 +0000
committernecoro <>2007-03-10 22:59:52 +0000
commit47a7b294e5a889afb932d371021d2b53adc20665 (patch)
tree4d53351b770b785eee790547d5574561e3c8b847 /portato/backend/package.py
parent22a0baf7f459b267febfb16c7bc90cf460323a87 (diff)
downloadportato-47a7b294e5a889afb932d371021d2b53adc20665.tar.gz
portato-47a7b294e5a889afb932d371021d2b53adc20665.tar.bz2
portato-47a7b294e5a889afb932d371021d2b53adc20665.zip
Added USE_EXPAND-support
Diffstat (limited to 'portato/backend/package.py')
-rw-r--r--portato/backend/package.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/portato/backend/package.py b/portato/backend/package.py
index ebe9e85..0039fc0 100644
--- a/portato/backend/package.py
+++ b/portato/backend/package.py
@@ -134,6 +134,27 @@ class Package:
else:
return False
+ def use_expanded (self, flag, suggest = None):
+ """Tests whether a useflag is an expanded one. If it is, this method returns the USE_EXPAND-value.
+
+ @param flag: the flag to check
+ @type flag: string
+ @param suggest: try this suggestion first
+ @type suggest: string
+ @returns: USE_EXPAND-value on success
+ @rtype: string or None"""
+
+ if not suggest is None:
+ if flag.startswith(suggest.lower()):
+ return suggest
+
+ for exp in self.get_global_settings("USE_EXPAND").split(" "):
+ lexp = exp.lower()
+ if flag.startswith(lexp):
+ return exp
+
+ return None
+
def get_cpv(self):
"""Returns full Category/Package-Version string.