From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/rpackage/
Date: Mon, 2 Jul 2012 16:52:27 +0000 (UTC) [thread overview]
Message-ID: <1341247369.39ec3079553c96ff8f1d0522b47d8f6f09fa6d7c.dywi@gentoo> (raw)
commit: 39ec3079553c96ff8f1d0522b47d8f6f09fa6d7c
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Jul 2 16:42:49 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Jul 2 16:42:49 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=39ec3079
DescriptionReader: decode non-str lines
modified: roverlay/rpackage/descriptionreader.py
---
roverlay/rpackage/descriptionreader.py | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/roverlay/rpackage/descriptionreader.py b/roverlay/rpackage/descriptionreader.py
index 94f36a3..1b3f62f 100644
--- a/roverlay/rpackage/descriptionreader.py
+++ b/roverlay/rpackage/descriptionreader.py
@@ -215,22 +215,23 @@ class DescriptionReader ( object ):
else:
fh = th.extractfile ( config.get ( 'DESCRIPTION.file_name' ) )
- # have to decode the lines
- read = lambda lines : [ line.decode().rstrip() for line in lines ]
else:
# open file handle only
fh = open ( filepath, 'r' )
- read = lambda lines : [ line.rstrip() for line in lines ]
- x = None
- read_lines = read ( fh.readlines() )
- del x, read
+
+ # decode lines of they're only bytes, using isinstance ( <>, str )
+ # 'cause isinstance ( <str>, bytes ) returns True
+ read_lines = tuple (
+ ( line if isinstance ( line, str ) else line.decode() ).rstrip()
+ for line in fh.readlines()
+ )
fh.close()
if not th is None: th.close()
del fh, th
- if hasattr ( self, 'write_desc_file' ):
+ if read_lines and hasattr ( self, 'write_desc_file' ):
try:
util.dodir ( DescriptionReader.WRITE_DESCFILES_DIR )
fh = open ( self.write_desc_file, 'w' )
next reply other threads:[~2012-07-02 16:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-02 16:52 André Erdmann [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-02-16 1:35 [gentoo-commits] proj/R_overlay:master commit in: roverlay/rpackage/ Benda XU
2013-08-21 13:51 André Erdmann
2013-08-21 13:51 André Erdmann
2013-08-20 21:46 André Erdmann
2013-07-25 13:28 André Erdmann
2013-07-25 13:25 André Erdmann
2013-07-25 8:47 André Erdmann
2013-07-25 8:47 André Erdmann
2013-07-23 18:34 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-07-23 18:34 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-07-11 16:29 André Erdmann
2013-04-25 16:44 André Erdmann
2013-02-09 20:45 André Erdmann
2012-08-07 8:50 André Erdmann
2012-07-30 8:52 André Erdmann
2012-07-06 22:19 André Erdmann
2012-07-03 17:48 André Erdmann
2012-06-29 22:48 André Erdmann
2012-06-28 15:55 André Erdmann
2012-06-28 15:55 André Erdmann
2012-06-27 14:46 André Erdmann
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=1341247369.39ec3079553c96ff8f1d0522b47d8f6f09fa6d7c.dywi@gentoo \
--to=dywi@mailerd.de \
--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