Logo Search packages:      
Sourcecode: sabayon version File versions  Download package

def lib::cache::cacheRepository::__update_catalog (   self,
  URL,
  timestamp = None 
) [private]

Update the catalog of resources in the cache with an updated entry

Definition at line 151 of file cache.py.

00151                                                      :
        """Update the catalog of resources in the cache with an updated entry"""
      if URL == None:
          return
      modified = 0

        # create the catalog if needed
      if self.catalog == None:
          self.catalog = libxml2.newDoc("1.0")
          self.root = self.catalog.newChild (None, "catalog", None)
          modified = 1
      if self.root == None:
          return

      try:
          child = self.root.xpathEval("/catalog/entry[@URL = '%s']" % URL)[0]
      except:
          child = None
      if child == None:
          child = self.root.newChild(None, "entry", None)
          child.setProp("URL", URL)
          if timestamp == None:
              timestamp = ""
          child.setProp("timestamp", timestamp)
          modified = 1
      else:
          if child.prop("URL") == URL:
            if timestamp != None:
                if timestamp != child.prop("timestamp"):
                  child.setProp("timestamp", timestamp)
                  modified = 1
            else:
                child.setProp("timestamp", "")
                modified = 1
      if modified == 1:
          self.__save_catalog()

    def __catalog_lookup(self, URL):


Generated by  Doxygen 1.6.0   Back to index