From: "Paweł Hajdan" <phajdan.jr@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/arch-tools:master commit in: /
Date: Thu, 3 Nov 2011 11:00:52 +0000 (UTC) [thread overview]
Message-ID: <575e47390093480f4b90e795bb2930fa6d85bb56.phajdan.jr@gentoo> (raw)
commit: 575e47390093480f4b90e795bb2930fa6d85bb56
Author: Pawel Hajdan, Jr <phajdan.jr <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 3 11:00:23 2011 +0000
Commit: Paweł Hajdan <phajdan.jr <AT> gentoo <DOT> org>
CommitDate: Thu Nov 3 11:00:23 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/arch-tools.git;a=commit;h=575e4739
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:
def init_screen(self):
(self.height, self.width) = self.screen.getmaxyx()
+ self.bugs_pad_width = self.width / 3 - 1
+ self.contents_pad_width = self.width - self.bugs_pad_width - 1
if self.height < 12 or self.width < 80:
raise TermTooSmall()
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.height - 2)
self.screen.refresh()
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)
def fill_contents_pad(self):
- width = 2 * self.width / 3
-
bug = self.bugs[self.bugs_pad_pos]
output = []
- output += textwrap.wrap(bug.summary(), width=width-2)
- output.append("-" * (width - 2))
+ output += textwrap.wrap(bug.summary(), width=self.contents_pad_width-2)
+ output.append("-" * (self.contents_pad_width - 2))
cpvs = bug.cpvs()
if cpvs:
- output += textwrap.wrap("Found package cpvs:", width=width-2)
+ output += textwrap.wrap("Found package cpvs:", width=self.contents_pad_width-2)
for cpv in cpvs:
- output += textwrap.wrap(cpv, width=width-2)
- output += textwrap.wrap("Press 'a' to add them to the stabilization queue.", width=width-2)
- output.append("-" * (width - 2))
+ output += textwrap.wrap(cpv, width=self.contents_pad_width-2)
+ output += textwrap.wrap("Press 'a' to add them to the stabilization queue.", width=self.contents_pad_width-2)
+ output.append("-" * (self.contents_pad_width - 2))
deps = [self.bug_for_id(dep_id) for dep_id in bug.depends_on()]
if deps:
- output += textwrap.wrap("Depends on:", width=width-2)
+ output += textwrap.wrap("Depends on:", width=self.contents_pad_width-2)
for dep in deps:
desc = "%d %s %s" % (dep.id_number(), dep.status(), dep.summary())
- output += textwrap.wrap(desc, width=width-2)
- output.append("-" * (width - 2))
+ output += textwrap.wrap(desc, width=self.contents_pad_width-2)
+ output.append("-" * (self.contents_pad_width - 2))
related = self.related_bugs[bug.id_number()]
if related:
- output += textwrap.wrap("Related bugs:", width=width-2)
+ output += textwrap.wrap("Related bugs:", width=self.contents_pad_width-2)
for related_bug in related:
if str(related_bug['bugid']) == str(bug.id_number()):
continue
desc = related_bug['bugid'] + " " + related_bug['desc']
- output += textwrap.wrap(desc, width=width-2)
- output.append("-" * (width - 2))
+ output += textwrap.wrap(desc, width=self.contents_pad_width-2)
+ output.append("-" * (self.contents_pad_width - 2))
if bug.id_number() in repoman_dict and repoman_dict[bug.id_number()]:
- output += textwrap.wrap("Repoman output:", width=width-2)
+ output += textwrap.wrap("Repoman output:", width=self.contents_pad_width-2)
lines = repoman_dict[bug.id_number()].split("\n")
for line in lines:
- output += textwrap.wrap(line, width=width-2)
- output.append("-" * (width - 2))
+ output += textwrap.wrap(line, width=self.contents_pad_width-2)
+ output.append("-" * (self.contents_pad_width - 2))
for comment in bug.comments():
for line in comment.split("\n"):
- output += textwrap.wrap(line, width=width-2)
- output.append("-" * (width - 2))
+ output += textwrap.wrap(line, width=self.contents_pad_width-2)
+ output.append("-" * (self.contents_pad_width - 2))
self.contents_pad_length = len(output)
- self.contents_pad = curses.newpad(max(self.contents_pad_length, self.height), width)
+ self.contents_pad = curses.newpad(max(self.contents_pad_length, self.height), self.contents_pad_width)
self.contents_pad.erase()
self.contents_pad_pos = 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()
next reply other threads:[~2011-11-03 11:01 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-03 11:00 Paweł Hajdan [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-07-10 20:29 [gentoo-commits] proj/arch-tools:master commit in: / Paweł Hajdan
2017-07-09 14:42 Paweł Hajdan
2015-01-05 14:41 Paweł Hajdan
2015-01-05 14:41 Paweł Hajdan
2015-01-05 14:41 Paweł Hajdan
2014-06-14 9:47 Paweł Hajdan
2014-04-07 12:40 Samuli Suominen
2014-02-12 7:06 Paweł Hajdan
2013-06-22 15:05 Paweł Hajdan
2013-06-22 14:57 Paweł Hajdan
2013-05-19 23:35 Paweł Hajdan
2013-03-11 21:56 Paweł Hajdan
2013-02-28 4:50 Paweł Hajdan
2013-02-28 4:50 Paweł Hajdan
2012-10-16 16:54 Paweł Hajdan
2012-10-16 16:54 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:02 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-08-01 11:08 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-08-01 7:28 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-06-04 9:18 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-03-27 15:26 Paweł Hajdan
2012-03-09 11:49 Paweł Hajdan
2012-03-09 11:49 Paweł Hajdan
2012-02-02 16:48 Paweł Hajdan
2012-01-27 14:55 Paweł Hajdan
2012-01-21 17:05 Paweł Hajdan
2011-12-14 7:23 Paweł Hajdan
2011-12-06 11:14 Paweł Hajdan
2011-12-01 18:56 Paweł Hajdan
2011-12-01 18:47 Paweł Hajdan
2011-12-01 18:47 Paweł Hajdan
2011-11-30 17:38 Paweł Hajdan
2011-11-23 8:59 Paweł Hajdan
2011-11-23 8:59 Paweł Hajdan
2011-11-21 8:34 Paweł Hajdan
2011-10-22 8:18 Paweł Hajdan
2011-10-21 15:15 Paweł Hajdan
2011-10-18 14:05 Paweł Hajdan
2011-10-16 3:51 Paweł Hajdan
2011-10-13 21:59 Paweł Hajdan
2011-10-04 21:46 Paweł Hajdan
2011-09-19 3:09 Paweł Hajdan
2011-08-07 3:26 Paweł Hajdan
2011-06-05 16:16 Paweł Hajdan
2011-06-02 15:41 Paweł Hajdan
2011-06-02 15:38 Paweł Hajdan
2011-05-25 19:51 Paweł Hajdan
2011-05-25 10:32 Paweł Hajdan
2011-05-22 15:31 Paweł Hajdan
2011-05-22 15:16 Paweł Hajdan
2011-05-22 13:36 Paweł Hajdan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=575e47390093480f4b90e795bb2930fa6d85bb56.phajdan.jr@gentoo \
--to=phajdan.jr@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox