Exemplo n.º 1
0
 def setProperty(self, name, value , source):
     if self.codebase != '':
         assert not isinstance(self.getProperty(name, None), str), \
          "Sourcestep %s has a codebase, other sourcesteps don't" \
          % self.name
         property_dict = self.getProperty(name, {})
         property_dict[self.codebase] = value
         LoggingBuildStep.setProperty(self, name, property_dict, source)
     else:
         assert not isinstance(self.getProperty(name, None), dict), \
          "Sourcestep %s does not have a codebase, other sourcesteps do" \
          % self.name
         LoggingBuildStep.setProperty(self, name, value, source)
Exemplo n.º 2
0
    def updateSourceProperty(self, name, value, source=''):
        """
        Update a property, indexing the proeprty by codebase if codebase is not
        ''.  Source steps should generally use this instead of setProperty.
        """
        # pick a decent source name
        if source == '':
            source = self.__class__.__name__

        if self.codebase != '':
            assert not isinstance(self.getProperty(name, None), str), \
             "Sourcestep %s has a codebase, other sourcesteps don't" \
             % self.name
            property_dict = self.getProperty(name, {})
            property_dict[self.codebase] = value
            LoggingBuildStep.setProperty(self, name, property_dict, source)
        else:
            assert not isinstance(self.getProperty(name, None), dict), \
             "Sourcestep %s does not have a codebase, other sourcesteps do" \
             % self.name
            LoggingBuildStep.setProperty(self, name, value, source)