Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 145313 Details for
Bug 212330
[PATCH] app-portage/elogv enhancement
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
elogv patch
elogv-colors.diff (text/plain), 3.29 KB, created by
Michał Kiedrowicz
on 2008-03-04 23:25:58 UTC
(
hide
)
Description:
elogv patch
Filename:
MIME Type:
Creator:
Michał Kiedrowicz
Created:
2008-03-04 23:25:58 UTC
Size:
3.29 KB
patch
obsolete
>Index: elogv >=================================================================== >--- elogv (wersja 434) >+++ elogv (kopia robocza) >@@ -84,6 +84,9 @@ > curses.init_pair(ewarn, curses.COLOR_YELLOW, curses.COLOR_BLACK) > curses.init_pair(eerror, curses.COLOR_RED, curses.COLOR_BLACK) > curses.init_pair(elog, curses.COLOR_MAGENTA, curses.COLOR_BLACK) >+ >+ # Character used to print the class of an elog >+ self.class_char = "*" > > # This attributes are used to manage the scrolling of the list > # of files >@@ -238,10 +241,16 @@ > else: > self.usel += n > >- self.file_pad.addstr(prev_usel,0, >+ self.file_pad.addstr(prev_usel,1, >+ self.class_char, >+ self.classes[prev_usel]) >+ self.file_pad.addstr(prev_usel,3, > "%s - %s" % (self.packages[prev_usel],self.dates[prev_usel]), > curses.color_pair(normal)) >- self.file_pad.addstr(self.usel,0, >+ self.file_pad.addstr(self.usel,1, >+ self.class_char, >+ self.classes[self.usel]) >+ self.file_pad.addstr(self.usel,3, > "%s - %s" % (self.packages[self.usel],self.dates[self.usel]), > curses.color_pair(selected)) > >@@ -315,6 +324,7 @@ > > self.packages = [] > self.dates = [] >+ self.classes = [] > self.file_pad = curses.newpad(len(self.file_list),self.width) > self.file_pad.clear() > >@@ -322,6 +332,7 @@ > (category,package_name,other) = item.split(":") > self.packages.append(category + "/" + package_name) > self.dates.append(other[:8]) >+ self.classes.append(self.get_class(item)) > > for i in range(0,len(self.file_list)): > if i == self.usel: >@@ -329,10 +340,40 @@ > else: > cp = normal > >- self.file_pad.addstr(i,0, >+ self.file_pad.addstr(i,1, >+ self.class_char, >+ self.classes[i]) >+ self.file_pad.addstr(i,3, > "%s - %s" % (self.packages[i],self.dates[i]), > curses.color_pair(cp)) > >+ def get_class(self,item): >+ """ >+ Get the highest elog class in a file >+ """ >+ filepath = os.path.join(elogdir,item) >+ f = file(filepath) >+ file_class = 0; >+ >+ for line in f: >+ if line.startswith('LOG:') and file_class < 1: >+ file_class = 1 >+ elif line.startswith('WARN:') and file_class < 2: >+ file_class = 2 >+ elif line.startswith('ERROR:') and file_class < 3: >+ file_class = 3 >+ >+ f.close() >+ >+ if file_class == 0: >+ return curses.color_pair(einfo) >+ elif file_class == 1: >+ return curses.color_pair(elog) >+ elif file_class == 2: >+ return curses.color_pair(ewarn) >+ else: >+ return curses.color_pair(eerror) >+ > def show_log(self): > """ > Display the selected file, if the length of the file is bigger than
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212330
: 145313 |
145350