Skip to content

Commit

Permalink
Class methods replaces by dict.get() method
Browse files Browse the repository at this point in the history
  • Loading branch information
hborkhuis committed Apr 25, 2012
1 parent 2734a70 commit fbd0bcc
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions master/buildbot/schedulers/base.py
Expand Up @@ -182,17 +182,6 @@ def getPendingBuildTimes(self):
"Returns a list of the next times that builds are scheduled, if known."
return []

## codebase related methods
## to have the code less dependent from input structure
def getRepository(self, codebase):
return self.codebases[codebase]['repository']

def getBranch(self, codebase):
return self.codebases[codebase].get('branch', None)

def getRevision(self, codebase):
return self.codebases[codebase].get('revision', None)

## change handling

def startConsumingChanges(self, fileIsImportant=None, change_filter=None,
Expand Down Expand Up @@ -378,9 +367,9 @@ def get_last_change_for_codebase(codebase):
if codebase not in changesByCodebase:
# codebase has no changes
# create a sourcestamp that has no changes
repository = self.getRepository(codebase)
branch = self.getBranch(codebase)
revision = self.getRevision(codebase)
repository = self.codebases[codebase]['repository']
branch = self.codebases[codebase].get('branch', None)
revision = self.codebases[codebase].get('revision', None)
yield self.master.db.sourcestamps.addSourceStamp(
codebase=codebase,
repository=repository,
Expand Down

0 comments on commit fbd0bcc

Please sign in to comment.