[SCM] build.samba.org - branch master updated

Jelmer Vernooij jelmer at samba.org
Thu Nov 11 14:17:59 MST 2010


The branch, master has been updated
       via  46d2d55 Reintroduce readonly parameter, remove unnecessary code.
      from  d67fc5a Use the correct form for cmp

http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 46d2d555c366289981592c9b3e9df75d9f2b84c3
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Nov 11 22:17:21 2010 +0100

    Reintroduce readonly parameter, remove unnecessary code.

-----------------------------------------------------------------------

Summary of changes:
 buildfarm/__init__.py |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py
index 51d4968..ea5ecbd 100644
--- a/buildfarm/__init__.py
+++ b/buildfarm/__init__.py
@@ -135,30 +135,26 @@ class BuildFarm(object):
 
 class CachingBuildFarm(BuildFarm):
 
-    def __init__(self, path=None, cachedirname=None):
-        self.cachedir = None
+    def __init__(self, path=None, readonly=False, cachedirname=None):
         super(CachingBuildFarm, self).__init__(path)
 
         if cachedirname:
             self.cachedir = os.path.join(self.path, cachedirname)
         else:
-            self.cachedir = os.path.join(self.path, "cache2")
+            self.cachedir = os.path.join(self.path, "cache")
         self.builds = self._open_build_results()
         self.upload_builds = self._open_upload_build_results()
+        self.readonly = readonly
 
     def _open_build_results(self):
         from buildfarm import data
-        if not self.cachedir:
-            return
         return data.CachingBuildResultStore(os.path.join(self.path, "data", "oldrevs"),
-                self.cachedir)
+                self.cachedir, reaodnly=self.readonly)
 
     def _open_upload_build_results(self):
         from buildfarm import data
-        if not self.cachedir:
-            return
         return data.CachingUploadBuildResultStore(os.path.join(self.path, "data", "upload"),
-                self.cachedir)
+                self.cachedir, readonly=self.readonly)
 
     def lcov_status(self, tree):
         """get status of build"""
@@ -183,11 +179,7 @@ class CachingBuildFarm(BuildFarm):
                 return None
             return ret
 
-        lcov_html = util.FileLoad(file)
-        perc = lcov_extract_percentage(lcov_html)
-        if perc is None:
-            ret = ""
-        else:
-            ret = perc
+        perc = super(CachingBuildFarm, self).lcov_status(tree)
+        if not self.readonly:
             util.FileSave(cachefile, ret)
         return perc


-- 
build.samba.org


More information about the samba-cvs mailing list