Commits

Michał Górny committed 6c4c097

Pass settings to FlagCache() and grab USE_EXPAND list.

  • Participants
  • Parent commits a3e8bf8

Comments (0)

Files changed (2)

lib/flaggie/cache.py

 
 	class FlagCache(DBAPICache):
 		aux_key = 'IUSE'
+		def __init__(self, dbapi, settings = None):
+			Caches.DBAPICache.__init__(self, dbapi)
+			self.use_expand_vars = settings.get('USE_EXPAND', '').split() \
+					if settings else []
 
 		@property
 		def glob(self):
 		def __getitem__(self, k):
 			return self.cache
 
-	def __init__(self, dbapi):
+	def __init__(self, dbapi, settings = None):
 		self.caches = {
-			'use': self.FlagCache(dbapi),
+			'use': self.FlagCache(dbapi, settings),
 			'kw': self.KeywordCache(dbapi),
 			'lic': self.LicenseCache(dbapi),
 			'env': self.EnvCache(dbapi)

lib/flaggie/cli.py

 def parse_actions(args, dbapi, settings, quiet = False, strict = False, \
 		cleanupact = [], dataout = sys.stdout, output = sys.stderr):
 	out = []
-	cache = Caches(dbapi)
+	cache = Caches(dbapi, settings)
 	actset = ActionSet(cache = cache)
 	had_pkgs = False