aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'client/gentoostats/metadata.py')
-rw-r--r--client/gentoostats/metadata.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/client/gentoostats/metadata.py b/client/gentoostats/metadata.py
index 7d13a4f..33f7bf9 100644
--- a/client/gentoostats/metadata.py
+++ b/client/gentoostats/metadata.py
@@ -5,8 +5,14 @@ from gentoolkit.enalyze.lib import FlagAnalyzer
from gentoolkit.enalyze.lib import KeywordAnalyser
class Metadata(object):
+ """
+ A class encapsulating all package metadata
+ """
def __init__(self, cpv):
+ """
+ Initialize the class with the cpv. All metadata are read from portage
+ """
self.repo, self.counter, self.build_time, self.size = VARDB.aux_get(cpv, ['repository', 'COUNTER', 'BUILD_TIME', 'SIZE'])
system_use = portage.settings['USE'].split()
@@ -19,27 +25,51 @@ class Metadata(object):
self.keyword = ka.get_inst_keyword_cpv(cpv)
def getPlusFlags(self):
+ """
+ Return list of enabled useflags
+ """
return list(self.flags[0])
def getMinusFlags(self):
+ """
+ Return list of disabled useflags
+ """
return list(self.flags[1])
def getUnsetFlags(self):
+ """
+ Return list of unset useflags
+ """
return list(self.flags[2])
def getKeyword(self):
+ """
+ Return keyword used to install package
+ """
return self.keyword
def getRepoName(self):
+ """
+ Return the repository the package was installed from
+ """
if self.repo:
return self.repo
return 'Unknown'
def getCounter(self):
+ """
+ Return the package install counter. How's this useful ?
+ """
return self.counter
def getBuildTime(self):
+ """
+ Return the time package was built
+ """
return self.build_time
def getSize(self):
+ """
+ Return the size of the installed package
+ """
return self.size