Skip to content

Commit

Permalink
Merge branch '1.0.x' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Oct 25, 2017
2 parents 7a6dead + 29b38e2 commit 88f4d1e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion reprounzip-docker/reprounzip/unpackers/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def docker_setup(args):
docker_setup_create(args)
try:
docker_setup_build(args)
except:
except BaseException:
Path(args.target[0]).rmtree(ignore_errors=True)
raise

Expand Down
2 changes: 2 additions & 0 deletions reprounzip-qt/reprounzip_qt/qt_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import cgi
import locale
from PyQt4 import QtCore, QtGui
import sys


class Terminal(QtGui.QWidget):
Expand Down Expand Up @@ -38,6 +39,7 @@ def __init__(self, cmdline, env, input_enabled=False,
if environ.contains('PYTHONHOME'):
environ.remove('PYTHONPATH')
environ.remove('PYTHONHOME')
if sys.platform == 'darwin':
environ.insert(
'PATH',
(environ.value('PATH', '/usr/bin:/bin:/usr/sbin:/sbin') +
Expand Down
6 changes: 3 additions & 3 deletions reprounzip/reprounzip/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __getattr__(self, name,
unicode_ = unicode # noqa: F821


def flatten(n, l):
def flatten(n, iterable):
"""Flattens an iterable by repeatedly calling chain.from_iterable() on it.
>>> a = [[1, 2, 3], [4, 5, 6]]
Expand All @@ -105,8 +105,8 @@ def flatten(n, l):
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
"""
for _ in irange(n):
l = itertools.chain.from_iterable(l)
return l
iterable = itertools.chain.from_iterable(iterable)
return iterable


class UniqueNames(object):
Expand Down
24 changes: 12 additions & 12 deletions reprozip/reprozip/tracer/linux_pkgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ def search_for_files(self, files):
continue
with listfile.open('rb') as fp:
# Read paths from the file
l = fp.readline()
while l:
if l[-1:] == b'\n':
l = l[:-1]
path = Path(l)
line = fp.readline()
while line:
if line[-1:] == b'\n':
line = line[:-1]
path = Path(line)
# If it's one of the requested paths
if path in requested:
# If we had assigned it to a package already, undo
Expand All @@ -134,7 +134,7 @@ def search_for_files(self, files):
# Else assign to the package
else:
found[path] = pkgname
l = fp.readline()
line = fp.readline()

# Remaining files are not from packages
self.unknown_files.update(
Expand Down Expand Up @@ -176,16 +176,16 @@ def _create_package(self, pkgname):
stdout=subprocess.PIPE)
try:
size = version = None
for l in p.stdout:
fields = l.split()
for line in p.stdout:
fields = line.split()
# Removes :arch
name = fields[0].decode('ascii').split(':', 1)[0]
if name == pkgname:
version = fields[1].decode('ascii')
size = int(fields[2].decode('ascii')) * 1024 # kbytes
section = fields[3].decode('ascii')
break
for l in p.stdout: # finish draining stdout
for line in p.stdout: # finish draining stdout
pass
finally:
p.wait()
Expand All @@ -209,9 +209,9 @@ def _get_packages_for_file(self, filename):
out, err = p.communicate()
if p.returncode != 0:
return None
return [l.strip().decode('iso-8859-1')
for l in out.splitlines()
if l]
return [line.strip().decode('iso-8859-1')
for line in out.splitlines()
if line]

def _create_package(self, pkgname):
p = subprocess.Popen(['rpm', '-q', pkgname,
Expand Down
6 changes: 3 additions & 3 deletions reprozip/reprozip/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __getattr__(self, name,
unicode_ = unicode # noqa: F821


def flatten(n, l):
def flatten(n, iterable):
"""Flattens an iterable by repeatedly calling chain.from_iterable() on it.
>>> a = [[1, 2, 3], [4, 5, 6]]
Expand All @@ -105,8 +105,8 @@ def flatten(n, l):
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
"""
for _ in irange(n):
l = itertools.chain.from_iterable(l)
return l
iterable = itertools.chain.from_iterable(iterable)
return iterable


class UniqueNames(object):
Expand Down

0 comments on commit 88f4d1e

Please sign in to comment.