Skip to content

Commit

Permalink
use list of tuples instead of dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
chase committed Mar 10, 2015
1 parent f26b052 commit 499877c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
23 changes: 10 additions & 13 deletions master/buildbot/config.py
Expand Up @@ -414,21 +414,18 @@ def getEnvironmentVersions():
import twisted
from buildbot import version as bbversion

py_version_info = (sys.version_info.major,
sys.version_info.minor,
sys.version_info.micro)
pyversion = '.'.join(map(str, py_version_info))
pyversion = '.'.join(map(str, sys.version_info[:3]))

tx_version_info= (twisted.version.major,
twisted.version.minor,
twisted.version.micro)
txversion = '.'.join(map(str, tx_version_info))

return {
'pyversion': pyversion,
'bbversion': bbversion,
'txversion': txversion,
}
return [
('Python version', pyversion),
('Buildbot version', bbversion),
('Twisted version', txversion),
]

def load_db(self, filenamekk, config_dict):
self.db = dict(db_url=self.getDbUrlFromConfig(config_dict))
Expand Down Expand Up @@ -620,12 +617,12 @@ def load_www(self, filename, config_dict):
(', '.join(unknown),))

if www_cfg.get('versions') is None:
www_cfg['versions'] = {}
www_cfg['versions'] = []

if not isinstance(www_cfg['versions'], dict):
error("'versions' must be a dictionary")
if not isinstance(www_cfg['versions'], list):
error("'versions' must be a list of tuples")

www_cfg['env_versions'] = self.getEnvironmentVersions()
www_cfg['versions'] = self.getEnvironmentVersions() + www_cfg['versions']

self.www.update(www_cfg)

Expand Down
3 changes: 0 additions & 3 deletions www/base/src/app/about/about.controller.coffee
@@ -1,10 +1,7 @@
class About extends Controller
constructor: ($scope, config, buildbotService) ->
versions = config.versions

$scope.config = config
$scope.versions = config.versions
$scope.env_versions = config.env_versions

#$scope.bower_configs = bower_configs
buildbotService.all('application.spec').getList().then (specs) ->
Expand Down
5 changes: 1 addition & 4 deletions www/base/src/app/about/about.tpl.jade
Expand Up @@ -5,12 +5,9 @@
.row
.col-sm-4
ul
li Python version: {{config.env_versions.pyversion}}
li Buildbot version: {{config.env_versions.bbversion}}
li Twisted version: {{config.env_versions.txversion}}
li Project Infos:
a(ng-href="{{config.titleURL}}") {{config.title}}
li(ng-repeat="(k, v) in config.versions" ng-bind-template="{{k}}: {{v}}")
li(ng-repeat="v in config.versions" ng-bind-template="{{v[0]}}: {{v[1]}}")
.row
small

Expand Down

0 comments on commit 499877c

Please sign in to comment.