aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'client/gentoostats')
-rw-r--r--client/gentoostats/environment.py2
-rw-r--r--client/gentoostats/metadata.py4
-rw-r--r--client/gentoostats/packages.py4
-rw-r--r--client/gentoostats/payload.py32
4 files changed, 21 insertions, 21 deletions
diff --git a/client/gentoostats/environment.py b/client/gentoostats/environment.py
index 2e92ca3..80e717b 100644
--- a/client/gentoostats/environment.py
+++ b/client/gentoostats/environment.py
@@ -34,7 +34,7 @@ class Environment(object):
if profilever is None:
try:
for parent in portage.grabfile(os.path.join(profile, 'parent')):
- profilever = relative_profile_path(self.portdir,os.path.join(profile, parent))
+ profilever = relative_profile_path(self.portdir, os.path.join(profile, parent))
if profilever is not None:
break
except portage.exception.PortageException:
diff --git a/client/gentoostats/metadata.py b/client/gentoostats/metadata.py
index fb36a12..7d13a4f 100644
--- a/client/gentoostats/metadata.py
+++ b/client/gentoostats/metadata.py
@@ -7,7 +7,7 @@ from gentoolkit.enalyze.lib import KeywordAnalyser
class Metadata(object):
def __init__(self, cpv):
- self.repo, self.counter, self.build_time, self.size = VARDB.aux_get(cpv,['repository','COUNTER','BUILD_TIME','SIZE'])
+ self.repo, self.counter, self.build_time, self.size = VARDB.aux_get(cpv, ['repository', 'COUNTER', 'BUILD_TIME', 'SIZE'])
system_use = portage.settings['USE'].split()
fa = FlagAnalyzer(system=system_use)
@@ -15,7 +15,7 @@ class Metadata(object):
arch = portage.settings['ARCH']
accept_keywords = portage.settings['ACCEPT_KEYWORDS'].split()
- ka = KeywordAnalyser(arch=arch,accept_keywords=accept_keywords)
+ ka = KeywordAnalyser(arch=arch, accept_keywords=accept_keywords)
self.keyword = ka.get_inst_keyword_cpv(cpv)
def getPlusFlags(self):
diff --git a/client/gentoostats/packages.py b/client/gentoostats/packages.py
index 2d8d677..39bbde9 100644
--- a/client/gentoostats/packages.py
+++ b/client/gentoostats/packages.py
@@ -11,8 +11,8 @@ class Packages(object):
return sorted(installed_cps)
return installed_cps
- def getInstalledCPVs(self,sort=False):
+ def getInstalledCPVs(self, sort=False):
installed_cpvs = VARDB.cpv_all()
if sort:
- return installed_cpvs
+ return sorted(installed_cpvs)
return installed_cpvs
diff --git a/client/gentoostats/payload.py b/client/gentoostats/payload.py
index 40532c5..1e98b75 100644
--- a/client/gentoostats/payload.py
+++ b/client/gentoostats/payload.py
@@ -29,35 +29,35 @@ class Payload(object):
def update(self):
env = Environment()
- self.payload['PLATFORM'] = 'Unknown' if self.__masked('ENV','PLATFORM') else env.getPlatform()
- self.payload['LASTSYNC'] = 'Unknown' if self.__masked('ENV','LASTSYNC') else env.getLastSync()
- self.payload['PROFILE'] = 'Unknown' if self.__masked('ENV','PROFILE') else env.getProfile()
+ self.payload['PLATFORM'] = 'Unknown' if self.__masked('ENV', 'PLATFORM') else env.getPlatform()
+ self.payload['LASTSYNC'] = 'Unknown' if self.__masked('ENV', 'LASTSYNC') else env.getLastSync()
+ self.payload['PROFILE'] = 'Unknown' if self.__masked('ENV', 'PROFILE') else env.getProfile()
- for var in ['ARCH','CHOST','CFLAGS','CXXFLAGS','FFLAGS','LDFLAGS','MAKEOPTS','SYNC']:
- self.payload[var] = None if self.__masked('ENV',var) else env.getVar(var)
+ for var in ['ARCH', 'CHOST', 'CFLAGS', 'CXXFLAGS', 'FFLAGS', 'LDFLAGS', 'MAKEOPTS', 'SYNC']:
+ self.payload[var] = None if self.__masked('ENV', var) else env.getVar(var)
- for var in ['ACCEPT_KEYWORDS','LANG','GENTOO_MIRRORS','FEATURES','USE']:
- self.payload[var] = [] if self.__masked('ENV',var) else env.getVar(var).split()
+ for var in ['ACCEPT_KEYWORDS', 'LANG', 'GENTOO_MIRRORS', 'FEATURES', 'USE']:
+ self.payload[var] = [] if self.__masked('ENV', var) else env.getVar(var).split()
self.payload['PACKAGES'] = dict()
for cpv in Packages().getInstalledCPVs():
m = Metadata(cpv)
p = dict()
- p['REPO'] = None if self.__masked('PACKAGES','REPO') else m.getRepoName()
- p['KEYWORD'] = None if self.__masked('PACKAGES','KEYWORD') else m.getKeyword()
+ p['REPO'] = None if self.__masked('PACKAGES', 'REPO') else m.getRepoName()
+ p['KEYWORD'] = None if self.__masked('PACKAGES', 'KEYWORD') else m.getKeyword()
p['USE'] = dict()
- p['USE']['PLUS'] = [] if self.__masked('PACKAGES','USE_PLUS') else m.getPlusFlags()
- p['USE']['MINUS'] = [] if self.__masked('PACKAGES','USE_MINUS') else m.getMinusFlags()
- p['USE']['UNSET'] = [] if self.__masked('PACKAGES','USE_UNSET') else m.getUnsetFlags()
- p['COUNTER'] = None if self.__masked('PACKAGES','COUNTER') else m.getCounter()
- p['SIZE'] = None if self.__masked('PACKAGES','SIZE') else m.getSize()
- p['BUILD_TIME'] = None if self.__masked('PACKAGES','BUILD_TIME') else m.getBuildTime()
+ p['USE']['PLUS'] = [] if self.__masked('PACKAGES', 'USE_PLUS') else m.getPlusFlags()
+ p['USE']['MINUS'] = [] if self.__masked('PACKAGES', 'USE_MINUS') else m.getMinusFlags()
+ p['USE']['UNSET'] = [] if self.__masked('PACKAGES', 'USE_UNSET') else m.getUnsetFlags()
+ p['COUNTER'] = None if self.__masked('PACKAGES', 'COUNTER') else m.getCounter()
+ p['SIZE'] = None if self.__masked('PACKAGES', 'SIZE') else m.getSize()
+ p['BUILD_TIME'] = None if self.__masked('PACKAGES', 'BUILD_TIME') else m.getBuildTime()
self.payload['PACKAGES'][cpv] = p
def get(self):
return self.payload
- def dump(self,human=False):
+ def dump(self, human=False):
if human:
pprint.pprint(self.payload)
else: