aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Ochotnicky <sochotnicky@gmail.com>2009-07-07 23:37:06 +0200
committerStanislav Ochotnicky <sochotnicky@gmail.com>2009-07-07 23:56:48 +0200
commita0f2c1c8f0cb6bc6556f442a3168d13fd41cd606 (patch)
tree8a23d82f68cb36926fec92606601046d4175c072
parentFixed regression when we started installing deps (diff)
downloadcollagen-a0f2c1c8f0cb6bc6556f442a3168d13fd41cd606.tar.gz
collagen-a0f2c1c8f0cb6bc6556f442a3168d13fd41cd606.tar.bz2
collagen-a0f2c1c8f0cb6bc6556f442a3168d13fd41cd606.zip
Changed to protocol and added documentation
-rw-r--r--src/protocol/__init__.py44
1 files changed, 31 insertions, 13 deletions
diff --git a/src/protocol/__init__.py b/src/protocol/__init__.py
index aca0611..492ac22 100644
--- a/src/protocol/__init__.py
+++ b/src/protocol/__init__.py
@@ -3,9 +3,15 @@
class MatchboxCommand(object): pass
class GetNextPackage(MatchboxCommand):
+ """
+ Matchbox command that will make matchbox return with GetNextPackageReply
+ """
pass
class PackageInfo(object):
+ """
+ Package info that will be inserted into database
+ """
def __init__(self):
self.name = None
self.version = None
@@ -16,26 +22,38 @@ class PackageInfo(object):
self.error = None
self.emerge_info = None
-class PackageContent(object):
- def __init__(self):
- self.type = None
- self.path = None
- self.hash = None
- self.modified = 0
-
class AddPackageInfo(MatchboxCommand):
- def __init__(self, package_info):
- self.package_info = package_info
+ def __init__(self, package_infos):
+ """
+ Command for Matchbox to add information about packages into database
+
+ @param package_infos: List of PackageInfo objects
+ @type package_infos: list
+ """
+ if type(package_infos) is not list:
+ raise TypeError("Parameter need to be a list of PackageInfo objects")
+ self.package_infos = package_infos
class MatchboxReply(object): pass
class GetNextPackageReply(MatchboxReply):
- def __init__(self, package_name, version, use_flags):
+ """
+ Reply for GetNextPackage command. This specifies package that should be compiled
+ by tinderbox
+ """
+
+ def __init__(self, package_name, version=None, use_flags=None):
+ """
+ @param package_name: package name and category (CP). e.g dev-util/git
+ @type package_name: string
+ @param version: version of package to compile. If None all versions will be compiled
+ @type version: string
+ @param use_flags: extra use flags to enable/disable for this build
+ @type use_flags: list of strings (e.g. ['-unicode','gtk'])
+
+ """
self.package_name = package_name
self.version = version
self.use_flags = use_flags
-
-
-