Re: [Yum-devel] [PATCH] Fix blank line at end of all scriptlet output

2010-05-21 Thread Jeroen van Meeuwen
James Antill wrote: > 'abcd '.rstrip() == 'abcd' > > ...I guess we could do: > > msg.rstrip('\n').split('\n') > > ...everyone prefer that? > I'm thinking just rstrip() without the '\n' would suffice, no? ;-) -- Jeroen ___ Yum-devel mailing list Y

Re: [Yum-devel] [PATCH] Fix blank line at end of all scriptlet output

2010-05-21 Thread Jeroen van Meeuwen
Seth Vidal wrote: > I like splitlines() and then checking if the last line is empty - but > > > we're bikeshedding the hell out of this. :) > No we're not! ;-) -- Jeroen ___ Yum-devel mailing list Yum-devel@lists.baseurl.org http://lists.baseurl.org

Re: [Yum-devel] [PATCH] Fix blank line at end of all scriptlet output

2010-05-21 Thread James Antill
On Fri, 2010-05-21 at 15:00 -0400, Seth Vidal wrote: > I like splitlines() and then checking if the last line is empty - but > Actually splitlines on it's own DTRT: In [1]: 'a\n'.splitlines() Out[1]: ['a'] In [2]: 'a\nb'.splitlines() Out[2]: ['a', 'b'] ...so fixed to use that (thanks Seth a

Re: [Yum-devel] [PATCH] Fix blank line at end of all scriptlet output

2010-05-21 Thread Seth Vidal
On Fri, 21 May 2010, James Antill wrote: On Fri, 2010-05-21 at 18:29 +0200, Jeroen van Meeuwen wrote: James Antill wrote: IIRC because stdout is not a terminal then stdio/etc. will turn it into "block buffered" mode. So we tend to get output like: "warning: blah\nwarning: foo\nsomethingels

Re: [Yum-devel] [PATCH] Fix blank line at end of all scriptlet output

2010-05-21 Thread James Antill
On Fri, 2010-05-21 at 18:29 +0200, Jeroen van Meeuwen wrote: > James Antill wrote: > > IIRC because stdout is not a terminal then stdio/etc. will turn it into > > "block buffered" mode. So we tend to get output like: > > > > "warning: blah\nwarning: foo\nsomethingelse\n" > > > > ...and we want t

Re: [Yum-devel] [PATCH] Fix blank line at end of all scriptlet output

2010-05-21 Thread Jeroen van Meeuwen
James Antill wrote: > IIRC because stdout is not a terminal then stdio/etc. will turn it into > "block buffered" mode. So we tend to get output like: > > "warning: blah\nwarning: foo\nsomethingelse\n" > > ...and we want those as 3 lines, in the DB. So I just did a split(), but > that gives 4 lin

Re: [Yum-devel] [PATCH] Fix blank line at end of all scriptlet output

2010-05-21 Thread Ville Skyttä
On Friday 21 May 2010, James Antill wrote: > I guess a really want .readlines() from the string ... know how to do > that? If you really want the readlines() behavior: lines = StringIO.StringIO(the_string).readlines() But I suppose you might be looking for something like this instead: l

Re: [Yum-devel] [PATCH] Add --setopt to YumUtilBase commands

2010-05-21 Thread Seth Vidal
On Fri, 21 May 2010, James Antill wrote: --- utils.py |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/utils.py b/utils.py index 0445b88..5a694e2 100644 --- a/utils.py +++ b/utils.py @@ -166,6 +166,14 @@ class YumUtilBase(YumBaseCli): def doUtilConfigSetup(sel

[Yum-devel] [PATCH] Add --setopt to YumUtilBase commands

2010-05-21 Thread James Antill
--- utils.py |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/utils.py b/utils.py index 0445b88..5a694e2 100644 --- a/utils.py +++ b/utils.py @@ -166,6 +166,14 @@ class YumUtilBase(YumBaseCli): def doUtilConfigSetup(self,args = sys.argv[1:],pluginsTypes=(plugin

Re: [Yum-devel] [PATCH] Fix blank line at end of all scriptlet output

2010-05-21 Thread Seth Vidal
On Fri, 21 May 2010, James Antill wrote: On Fri, 2010-05-21 at 11:47 -0400, Seth Vidal wrote: On Fri, 21 May 2010, James Antill wrote: --- yum/history.py |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/yum/history.py b/yum/history.py index d5a167e..eaf264c 100

Re: [Yum-devel] [PATCH] Fix blank line at end of all scriptlet output

2010-05-21 Thread James Antill
On Fri, 2010-05-21 at 11:47 -0400, Seth Vidal wrote: > > On Fri, 21 May 2010, James Antill wrote: > > > --- > > yum/history.py |7 ++- > > 1 files changed, 6 insertions(+), 1 deletions(-) > > > > diff --git a/yum/history.py b/yum/history.py > > index d5a167e..eaf264c 100644 > > --- a/yum/h

Re: [Yum-devel] [PATCH] Fix blank line at end of all scriptlet output

2010-05-21 Thread Seth Vidal
On Fri, 21 May 2010, James Antill wrote: --- yum/history.py |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/yum/history.py b/yum/history.py index d5a167e..eaf264c 100644 --- a/yum/history.py +++ b/yum/history.py @@ -507,7 +507,12 @@ class YumHistory: cur =

Re: [Yum-devel] [PATCH] Dump False and 0 as their values, and not the empty string

2010-05-21 Thread Seth Vidal
On Fri, 21 May 2010, James Antill wrote: --- yum/config.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/yum/config.py b/yum/config.py index 3610b91..949751a 100644 --- a/yum/config.py +++ b/yum/config.py @@ -752,7 +752,7 @@ class YumConf(StartupConf): if

[Yum-devel] [PATCH] Dump False and 0 as their values, and not the empty string

2010-05-21 Thread James Antill
--- yum/config.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/yum/config.py b/yum/config.py index 3610b91..949751a 100644 --- a/yum/config.py +++ b/yum/config.py @@ -752,7 +752,7 @@ class YumConf(StartupConf): if isinstance(getattr(self, attr), types.Meth

[Yum-devel] [PATCH] Fix blank line at end of all scriptlet output

2010-05-21 Thread James Antill
--- yum/history.py |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/yum/history.py b/yum/history.py index d5a167e..eaf264c 100644 --- a/yum/history.py +++ b/yum/history.py @@ -507,7 +507,12 @@ class YumHistory: cur = self._get_cursor() if cur is None