diff options
Diffstat (limited to 'modules/package_module.py')
-rw-r--r-- | modules/package_module.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/modules/package_module.py b/modules/package_module.py index 442bdcd..73c789d 100644 --- a/modules/package_module.py +++ b/modules/package_module.py @@ -29,17 +29,19 @@ class Package(object): def __init__(self, raw_data): self.raw_string = raw_data - + self.name = None self.version = None self.revision = None self.major_minor = None self.raw_name = None - + + self.package_version = None + self.category = None - + self.parse_raw_string(raw_data) - + self.handle_special_cases() @property @@ -58,24 +60,24 @@ class Package(object): split_string = portage_module.split_package_into_parts(raw_string) if None != split_string: #[cat, pkgname, version, rev ] - self.category,self.name,self.version,self.revision = split_string + self.category, self.name, self.version, self.revision = split_string self.raw_name = self.name self.major_minor = self.parse_mm(self.version) # else: # print "Error, " + raw_string + " is not a valid package!" - + def parse_mm(self, version): return '.'.join(version.split('.')[0:2]) - + def print_info(self): print "Name: " + str(self.name) print "Version: " + str(self.package_version) print "Name+Version: " + str(self.name_plus_version) print "Raw: " + str(self.raw_string) - + def __repr__(self): return self.name_plus_version - + class PackageStatus: def __init__(self, name, portage_version, gnome_version, latest_version, status, stable_version = False): self.name = name @@ -85,8 +87,8 @@ class PackageStatus: self.gnome_version = gnome_version self.latest_version = latest_version self.status = status - -class Status: + +class Status(object): def Compliant(self): return 0 def NeedUpdate(self): @@ -97,7 +99,7 @@ class Status: return 2 def StableNeedUpdate(self): return 3 - + property(Compliant) property(NeedUpdate) property(NotFound) |