App.get_last_build() method to replace duplicated code

Look @mvdan, I added a method to the App class!
This commit is contained in:
Hans-Christoph Steiner 2016-11-18 23:17:19 +01:00
parent 3db2c9869c
commit b91cdffe17
2 changed files with 9 additions and 9 deletions

View file

@ -239,6 +239,12 @@ class App():
self.__dict__[k] = v
self._modified.add(k)
def get_last_build(self):
if len(self.builds) > 0:
return self.builds[-1]
else:
return Build()
TYPE_UNKNOWN = 0
TYPE_OBSOLETE = 1