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 8c19a9a378019ef669843c7082bb64512aaec886
parent 43b60847ab573c449a52aaed497c378ce8f2262c
Author: rsiddharth <s@ricketyspace.net>
Date:   Thu,  9 Feb 2017 02:37:27 +0000

Fix readme_link_fmt variable.

* gd_diff.py (construct_table_row): Add `release` as the first
  argument.
  (generate_wiki_table): Update function.
* tests/test_gd_diff.py (test_construct_table_row): Update method.

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

diff --git a/gd_diff.py b/gd_diff.py @@ -39,7 +39,7 @@ gns_wiki = 'http://gnewsense.org' # fmt readme_link_fmt = '/'.join([sv_bzr_http, 'lh', 'gnewsense', - 'packages-parkes', '{}', 'annotate', + 'packages-{}', '{}', 'annotate', 'head:', 'debian', 'README.gNewSense']) readme_url_fmt = '/'.join([sv_bzr_gns, 'packages-{}', '{}','debian', 'README.gNewSense']) @@ -362,7 +362,7 @@ def get_wiki_page_data(release): return pkgs_noreadmes, table_data -def construct_table_row(pkg, change, reason): +def construct_table_row(release, pkg, change, reason): """Return a table row in moinmoin wiki markup. """ @@ -371,7 +371,7 @@ def construct_table_row(pkg, change, reason): if reason is None: reason = ' ' - more_info_link = readme_link_fmt.format(pkg) + more_info_link = readme_link_fmt.format(release, pkg) return '||{}||{}||{}||[[{}|more_info]]'.format(pkg, change, reason, more_info_link) @@ -386,7 +386,7 @@ def generate_wiki_table(release): for pkg, fields in table_data.items(): change = fields['Change-Type'] reason = fields['Changed-From-Debian'] - wiki_table += construct_table_row(pkg, change, reason) + '\n' + wiki_table += construct_table_row(release, pkg, change, reason) + '\n' return pkgs_noreadmes, wiki_table diff --git a/tests/test_gd_diff.py b/tests/test_gd_diff.py @@ -393,37 +393,37 @@ class TestGdDiff(object): value is None) def test_construct_table_row(self): - row = construct_table_row('antlr', 'Modified', + row = construct_table_row('ucclia', 'antlr', 'Modified', 'Removed example with non-free files') - columns = row.split('||')[1:] + columns = row.split('||')[1:-1] assert_equal(columns[0], 'antlr') assert_equal(columns[1], 'Modified') assert_equal(columns[2], 'Removed example with non-free files') - assert_equal(columns[3] , '[[http://bzr.savannah.gnu.org/lh/gnewsense/packages-parkes/antlr/annotate/head:/debian/README.gNewSense|more_info]]') + assert_equal(columns[3] , '[[http://bzr.savannah.gnu.org/lh/gnewsense/packages-ucclia/antlr/annotate/head:/debian/README.gNewSense|more_info]]') - row = construct_table_row('antlr', None, + row = construct_table_row('ucclia', 'antlr', None, 'Removed example with non-free files') - columns = row.split('||')[1:] + columns = row.split('||')[1:-1] assert_equal(columns[0], 'antlr') assert_equal(columns[1], ' ') assert_equal(columns[2], 'Removed example with non-free files') - assert_equal(columns[3] , '[[http://bzr.savannah.gnu.org/lh/gnewsense/packages-parkes/antlr/annotate/head:/debian/README.gNewSense|more_info]]') + assert_equal(columns[3] , '[[http://bzr.savannah.gnu.org/lh/gnewsense/packages-ucclia/antlr/annotate/head:/debian/README.gNewSense|more_info]]') - row = construct_table_row('antlr', 'Modified', + row = construct_table_row('ucclia', 'antlr', 'Modified', None) - columns = row.split('||')[1:] + columns = row.split('||')[1:-1] assert_equal(columns[0], 'antlr') assert_equal(columns[1], 'Modified') assert_equal(columns[2], ' ') - assert_equal(columns[3] , '[[http://bzr.savannah.gnu.org/lh/gnewsense/packages-parkes/antlr/annotate/head:/debian/README.gNewSense|more_info]]') + assert_equal(columns[3] , '[[http://bzr.savannah.gnu.org/lh/gnewsense/packages-ucclia/antlr/annotate/head:/debian/README.gNewSense|more_info]]') - row = construct_table_row('antlr', None, + row = construct_table_row('ucclia', 'antlr', None, None) - columns = row.split('||')[1:] + columns = row.split('||')[1:-1] assert_equal(columns[0], 'antlr') assert_equal(columns[1], ' ') assert_equal(columns[2], ' ') - assert_equal(columns[3] , '[[http://bzr.savannah.gnu.org/lh/gnewsense/packages-parkes/antlr/annotate/head:/debian/README.gNewSense|more_info]]') + assert_equal(columns[3] , '[[http://bzr.savannah.gnu.org/lh/gnewsense/packages-ucclia/antlr/annotate/head:/debian/README.gNewSense|more_info]]') def test_generate_wiki_table(self):