Commits

Michał Górny committed c50e624

config, cli: switch to explicit VCSLoader instantiation.

Comments (0)

Files changed (3)

smartliverebuild/cli.py

 from portage.data import portage_uid, portage_gid
 
 from smartliverebuild import PV
-from smartliverebuild.config import Config
+from smartliverebuild.config import Config, conf_getvcs
 from smartliverebuild.core import SmartLiveRebuild, SLRFailure
 from smartliverebuild.output import out
-from smartliverebuild.vcsload import GetVCS
 
 def check_downgrade(opt, optstr, val):
 	if val not in ('always', 'same-pv', 'never'):
 def check_vcslist(opt, optstr, val):
 	val = val.split(',')
 	for vcs in val:
-		if GetVCS(vcs) is None:
+		if conf_getvcs(vcs) is None:
 			raise OptionValueError("option %s: VCS eclass '%s' is not supported." % (optstr, vcs))
 	return val
 

smartliverebuild/config.py

 import portage
 
 from smartliverebuild.output import out
-from smartliverebuild.vcsload import GetVCS
+from smartliverebuild.vcsload import VCSLoader
+
+conf_getvcs = VCSLoader()
 
 class Config(ConfigParser):
 	def __init__(self, settings = None):
 				if v != '':
 					val[k] = []
 					for vcs in v.split(','):
-						if GetVCS(vcs):
+						if conf_getvcs(vcs):
 							val[k].append(vcs)
 						else:
 							out.err('VCS type not supported: %s' % vcs)
 				val[k] = v
 
 		return val
-
-

smartliverebuild/vcsload.py

 						raise ImportError('Unable to find a matching class in %s' % modname)
 
 		return self.vcs_cache[eclassname]
-
-GetVCS = VCSLoader()