From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RLv2b-0000wU-Pu for garchives@archives.gentoo.org; Thu, 03 Nov 2011 11:01:02 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DF8E321C03C; Thu, 3 Nov 2011 11:00:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id A0A8521C03C for ; Thu, 3 Nov 2011 11:00:53 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E405D1B400B for ; Thu, 3 Nov 2011 11:00:52 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 2AD2880042 for ; Thu, 3 Nov 2011 11:00:52 +0000 (UTC) From: "Paweł Hajdan" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Paweł Hajdan" Message-ID: <575e47390093480f4b90e795bb2930fa6d85bb56.phajdan.jr@gentoo> Subject: [gentoo-commits] proj/arch-tools:master commit in: / X-VCS-Repository: proj/arch-tools X-VCS-Files: bugzilla-viewer.py X-VCS-Directories: / X-VCS-Committer: phajdan.jr X-VCS-Committer-Name: Paweł Hajdan X-VCS-Revision: 575e47390093480f4b90e795bb2930fa6d85bb56 Date: Thu, 3 Nov 2011 11:00:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 0c710b00-ef4e-4858-b97a-00e88553e4a6 X-Archives-Hash: e079b1a1489193dd35c85702f79773e0 commit: 575e47390093480f4b90e795bb2930fa6d85bb56 Author: Pawel Hajdan, Jr gentoo org> AuthorDate: Thu Nov 3 11:00:23 2011 +0000 Commit: Pawe=C5=82 Hajdan gentoo org> CommitDate: Thu Nov 3 11:00:23 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/arch-tools.gi= t;a=3Dcommit;h=3D575e4739 Fix bugs resulting in ncurses-induced "crashes". --- bugzilla-viewer.py | 46 +++++++++++++++++++++++----------------------- 1 files changed, 23 insertions(+), 23 deletions(-) diff --git a/bugzilla-viewer.py b/bugzilla-viewer.py index 48b253e..45584a5 100755 --- a/bugzilla-viewer.py +++ b/bugzilla-viewer.py @@ -160,12 +160,14 @@ class MainWindow: =20 def init_screen(self): (self.height, self.width) =3D self.screen.getmaxyx() + self.bugs_pad_width =3D self.width / 3 - 1 + self.contents_pad_width =3D self.width - self.bugs_pad_width - 1 =20 if self.height < 12 or self.width < 80: raise TermTooSmall() =20 self.screen.border() - self.screen.vline(1, self.width / 3, curses.ACS_VLINE, self.height - 2= ) + self.screen.vline(1, self.bugs_pad_width + 1, curses.ACS_VLINE, self.h= eight - 2) self.screen.refresh() =20 self.fill_bugs_pad() @@ -208,58 +210,56 @@ class MainWindow: self.bugs_pad.refresh( pos, 0, 1, 1, - self.height - 2, self.width / 3 - 1) + self.height - 2, self.bugs_pad_width) =20 def fill_contents_pad(self): - width =3D 2 * self.width / 3 - bug =3D self.bugs[self.bugs_pad_pos] =20 output =3D [] - output +=3D textwrap.wrap(bug.summary(), width=3Dwidth-2) - output.append("-" * (width - 2)) + output +=3D textwrap.wrap(bug.summary(), width=3Dself.contents_pad_wid= th-2) + output.append("-" * (self.contents_pad_width - 2)) =20 cpvs =3D bug.cpvs() if cpvs: - output +=3D textwrap.wrap("Found package cpvs:", width=3Dwidth-2) + output +=3D textwrap.wrap("Found package cpvs:", width=3Dself.content= s_pad_width-2) for cpv in cpvs: - output +=3D textwrap.wrap(cpv, width=3Dwidth-2) - output +=3D textwrap.wrap("Press 'a' to add them to the stabilization= queue.", width=3Dwidth-2) - output.append("-" * (width - 2)) + output +=3D textwrap.wrap(cpv, width=3Dself.contents_pad_width-2) + output +=3D textwrap.wrap("Press 'a' to add them to the stabilization= queue.", width=3Dself.contents_pad_width-2) + output.append("-" * (self.contents_pad_width - 2)) =20 deps =3D [self.bug_for_id(dep_id) for dep_id in bug.depends_on()] if deps: - output +=3D textwrap.wrap("Depends on:", width=3Dwidth-2) + output +=3D textwrap.wrap("Depends on:", width=3Dself.contents_pad_wi= dth-2) for dep in deps: desc =3D "%d %s %s" % (dep.id_number(), dep.status(), dep.summary()) - output +=3D textwrap.wrap(desc, width=3Dwidth-2) - output.append("-" * (width - 2)) + output +=3D textwrap.wrap(desc, width=3Dself.contents_pad_width-2) + output.append("-" * (self.contents_pad_width - 2)) =09 related =3D self.related_bugs[bug.id_number()] if related: - output +=3D textwrap.wrap("Related bugs:", width=3Dwidth-2) + output +=3D textwrap.wrap("Related bugs:", width=3Dself.contents_pad_= width-2) for related_bug in related: if str(related_bug['bugid']) =3D=3D str(bug.id_number()): continue desc =3D related_bug['bugid'] + " " + related_bug['desc'] - output +=3D textwrap.wrap(desc, width=3Dwidth-2) - output.append("-" * (width - 2)) + output +=3D textwrap.wrap(desc, width=3Dself.contents_pad_width-2) + output.append("-" * (self.contents_pad_width - 2)) =09 if bug.id_number() in repoman_dict and repoman_dict[bug.id_number()]: - output +=3D textwrap.wrap("Repoman output:", width=3Dwidth-2) + output +=3D textwrap.wrap("Repoman output:", width=3Dself.contents_pa= d_width-2) lines =3D repoman_dict[bug.id_number()].split("\n") for line in lines: - output +=3D textwrap.wrap(line, width=3Dwidth-2) - output.append("-" * (width - 2)) + output +=3D textwrap.wrap(line, width=3Dself.contents_pad_width-2) + output.append("-" * (self.contents_pad_width - 2)) =09 for comment in bug.comments(): for line in comment.split("\n"): - output +=3D textwrap.wrap(line, width=3Dwidth-2) - output.append("-" * (width - 2)) + output +=3D textwrap.wrap(line, width=3Dself.contents_pad_width-2) + output.append("-" * (self.contents_pad_width - 2)) =20 self.contents_pad_length =3D len(output) =20 - self.contents_pad =3D curses.newpad(max(self.contents_pad_length, self= .height), width) + self.contents_pad =3D curses.newpad(max(self.contents_pad_length, self= .height), self.contents_pad_width) self.contents_pad.erase() =20 self.contents_pad_pos =3D 0 @@ -280,7 +280,7 @@ class MainWindow: def refresh_contents_pad(self): self.contents_pad.refresh( self.contents_pad_pos, 0, - 1, self.width / 3 + 1, + 1, self.bugs_pad_width + 2, self.height - 2, self.width - 2) self.screen.refresh() =09