| Index: chrome/common/extensions/docs/server2/branch_utility.py
|
| diff --git a/chrome/common/extensions/docs/server2/branch_utility.py b/chrome/common/extensions/docs/server2/branch_utility.py
|
| index 6241750da2d42c744d6443d4db3329218981b914..b071c84e35d2bcf3bc8ae139ca99b0a5c87ff62f 100644
|
| --- a/chrome/common/extensions/docs/server2/branch_utility.py
|
| +++ b/chrome/common/extensions/docs/server2/branch_utility.py
|
| @@ -20,6 +20,9 @@ class ChannelInfo(object):
|
| '''
|
|
|
| def __init__(self, channel, branch, version):
|
| + assert isinstance(channel, basestring), channel
|
| + assert isinstance(branch, basestring), branch
|
| + assert isinstance(version, int) or version == 'trunk', version
|
| self.channel = channel
|
| self.branch = branch
|
| self.version = version
|
| @@ -122,9 +125,12 @@ class BranchUtility(object):
|
|
|
|
|
| def GetChannelInfo(self, channel):
|
| + version = self._ExtractFromVersionJson(channel, 'version')
|
| + if version != 'trunk':
|
| + version = int(version)
|
| return ChannelInfo(channel,
|
| self._ExtractFromVersionJson(channel, 'branch'),
|
| - self._ExtractFromVersionJson(channel, 'version'))
|
| + version)
|
|
|
| def GetStableChannelInfo(self, version):
|
| '''Given a |version| corresponding to a 'stable' version of Chrome, returns
|
| @@ -176,8 +182,8 @@ class BranchUtility(object):
|
| None,
|
| operator.itemgetter(1),
|
| True)
|
| - object_store.Set(channel_name, int(sorted_numbers[0][0]))
|
| - return int(sorted_numbers[0][0])
|
| + object_store.Set(channel_name, sorted_numbers[0][0])
|
| + return sorted_numbers[0][0]
|
|
|
| def GetBranchForVersion(self, version):
|
| '''Returns the most recent branch for a given chrome version number using
|
| @@ -195,8 +201,8 @@ class BranchUtility(object):
|
| # Here, entry['title'] looks like: '<title> - <version>.##.<branch>.##'
|
| version_title = entry['title'].split(' - ')[1].split('.')
|
| if version_title[0] == str(version):
|
| - self._branch_object_store.Set(str(version), int(version_title[2]))
|
| - return int(version_title[2])
|
| + self._branch_object_store.Set(str(version), version_title[2])
|
| + return version_title[2]
|
|
|
| raise ValueError('The branch for %s could not be found.' % version)
|
|
|
|
|