Git commit c825cde93a38001d2c074eba1eaf3c829d279d52 by Patrick Spendrin. Committed on 31/08/2015 at 22:37. Pushed by sengels into branch 'master'. some minor cleanups M +6 -12 bin/options.py M +4 -3 bin/portage.py http://commits.kde.org/emerge/c825cde93a38001d2c074eba1eaf3c829d279d52 diff --git a/bin/options.py b/bin/options.py index 92d55b2..68f0b27 100644 --- a/bin/options.py +++ b/bin/options.py @@ -93,14 +93,16 @@ class OptionsFeatures(OptionsBase): = ## whether to build the sqlite backend in akonadi instead of the m= ysql one self.akonadiBackendSqlite =3D False - = + ## enable python support in several packages. self.pythonSupport =3D False = - = ## stick to the gcc 4.4.7 version self.legacyGCC =3D False = + ## enable or disable the dependency to plasma + self.fullplasma =3D False + ## options for the fetch action class OptionsFetch(OptionsBase): def __init__(self): @@ -221,8 +223,6 @@ class OptionsPackage(OptionsBase): ##disable stripping of binary files #needed for mysql, striping make the library unusable self.disableStriping =3D False - = - = = class OptionsCMake(OptionsBase): def __init__(self): @@ -341,18 +341,12 @@ class Options(object): value =3D value in ['True', 'true', '1', 'ON', 'on'] = setattr( currentObject, currentKey, value ) - -# p =3D "" -# if self.__instances[a][0]: -# p +=3D self.__instances[a][0] + '.' -# if self.__verbose: -# print("mapped %s to %s%s with value %s" % (origKey, p, self._= _instances[a][2][b][0], value)) return True = = = def __readFromList( self, opts ): - """collect properties from a list of key=3Dvalule string""" + """collect properties from a list of key=3Dvalue string""" if opts =3D=3D None: return False result =3D False @@ -361,7 +355,7 @@ class Options(object): utils.debug('incomplete option %s' % entry, 3) continue (key, value) =3D entry.split( '=3D', 1 ) - if self.__setInstanceAttribute(key, value ): + if self.__setInstanceAttribute(key, value): result =3D True continue return result diff --git a/bin/portage.py b/bin/portage.py index 71ec6e2..fa3247e 100644 --- a/bin/portage.py +++ b/bin/portage.py @@ -203,7 +203,6 @@ class Portage(object): self.ignores =3D set() if ("Portage", "PACKAGE_IGNORES") in emergeSettings: self.ignores.update(emergeSettings.get("Portage","PACKAGE_IGNO= RES").split(";")) - = = def addPortageDir( self, directory ): """ adds the categories and packages of a portage directory """ @@ -271,7 +270,6 @@ class Portage(object): self.categories[ category ].append( PackageObjectB= ase( category=3Dcategory, subpackage=3Dpackage, package=3DsubPackage, enabl= ed=3D_enabled ) ) self.subpackages[ subPackage ].append( category + "/" = + package ) = - def getCategory( self, package ): """ returns the category of this package """ utils.debug( "getCategory: %s" % package, 2 ) @@ -339,7 +337,10 @@ class Portage(object): else: modulename =3D os.path.basename( fileName )[:-3].repla= ce('.', '_') loader =3D importlib.machinery.SourceFileLoader(module= name, fileName) - mod =3D loader.load_module(modulename) + try: + mod =3D loader.load_module() + except: + raise PortageException("Failed to load file %s" % = fileName, category, package) if not mod is None: subpackage, package =3D getSubPackage( category, packa= ge ) self._CURRENT_MODULE =3D ( fileName, category,subpack= age, package, mod )