gns-deb-diff

automate the documentation of the differences between gNewSense and Debian.
git clone git://git.ricketyspace.net/gns-deb-diff.git
Log | Files | Refs

commit f61cc88f69509c0d448d4c45960fb17d137b21e1
parent 32b5035c36e67926b2eb790b6df4d337baa8dc17
Author: rsiddharth <s@ricketyspace.net>
Date:   Fri,  6 Jan 2017 00:32:11 +0000

Re-write global variables.

* gd_diff.py (bzr_base_url, bzr_pkg_readme_fmt)
(readme_url_fmt): Remove variables.
(sv_bzr_http, sv_bzr_gns, readme_link_fmt)
(readme_url_fmt): Add variables.
(construct_table_row): Update function.
* tests/test_gd_diff.py (TestGdDiff.test_generate_wiki_table): Update
 method.

Diffstat:
gd_diff.py | 16+++++++++++-----
tests/test_gd_diff.py | 2+-
2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/gd_diff.py b/gd_diff.py @@ -29,10 +29,16 @@ field_list = [ 'Changed-From-Debian', ] -# bzr -bzr_base_url = 'bzr://bzr.savannah.gnu.org/gnewsense/' -bzr_pkg_readme_fmt = 'http://bzr.savannah.gnu.org/lh/gnewsense/packages-parkes/{}/annotate/head:/debian/README.gNewSense' -readme_url_fmt = '%s/packages-{}/{}/debian/README.gNewSense' % bzr_base_url +# urls +sv_bzr_http = 'http://bzr.savannah.gnu.org' +sv_bzr_gns = '/'.join(['bzr://bzr.savannah.gnu.org', 'gnewsense']) + +# fmt +readme_link_fmt = '/'.join([sv_bzr_http, 'lh', 'gnewsense', + 'packages-parkes', '{}', 'annotate', + 'head:', 'debian', 'README.gNewSense']) +readme_url_fmt = '/'.join([sv_bzr_gns, 'packages-{}', '{}','debian', + 'README.gNewSense']) def read_file(fpath): @@ -353,7 +359,7 @@ def construct_table_row(pkg, change, reason): if reason is None: reason = ' ' - more_info_link = bzr_pkg_readme_fmt.format(pkg) + more_info_link = readme_link_fmt.format(pkg) return '||{}||{}||{}||[[{}|more_info]]'.format(pkg, change, reason, more_info_link) diff --git a/tests/test_gd_diff.py b/tests/test_gd_diff.py @@ -437,7 +437,7 @@ class TestGdDiff(object): assert pkg in pkgs assert cols[3] == '[[{}|more_info]]'.format( - bzr_pkg_readme_fmt.format(pkg)) + readme_link_fmt.format(pkg)) pkgs.remove(pkg)