3
# Copyright 2014 Canonical Ltd
5
# Kyle Nitzsche <kyle.nitzsche@canonical.com>
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, version 3 of the License.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/
23
jdata=open('yuidoc.json')
25
majver=data['majorversion']
26
cmd="bzr version-info | grep revno | cut -f2 -d\ "
27
bzrrev=p = subprocess.Popen(cmd, shell=True, stdout = subprocess.PIPE, stderr = subprocess.PIPE).communicate()[0]
28
bzrrev = bzrrev.decode('utf-8')
29
bzrrev = bzrrev.rstrip()
30
data['version']=majver + '~bzr' + bzrrev
31
with open('yuidoc.json', 'w') as f:
32
json.dump(data, f, ensure_ascii=False, indent=4)