From f837844242142599d1dee84309468624f6dd2048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Tue, 8 Feb 2011 00:31:56 -0600 Subject: Added classes and exceptions --- config.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'config.py') diff --git a/config.py b/config.py index 223257d..6dcd348 100644 --- a/config.py +++ b/config.py @@ -39,3 +39,27 @@ blacklist = docs + "/blacklist.txt" whitelist = docs + "/whitelist.txt" pending = docs + "/pending" rsyncBlacklist = docs + "/rsyncBlacklist" + +# Classes and Exceptions +class NonValidFile(ValueError): pass +class NonValidDir(ValueError): pass +class NonValidCommand(ValueError): pass + +class Package: + """ An object that has information about a package. """ + package_info={ "name" : False, + "version" : False, + "arch" : False, + "license" : False, + "location": False} + + def __setitem__(self, key, item): + return self.package_info.__setitem__(key, item) + + def __getitem__(self, key): + return self.package_info.__getitem__(key) + + def __unicode__(self): + return str(self.package_info) + + -- cgit v1.2.3