Commit 51ed8e44 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

from python2 to python3 > ok from command line

parent 0606ebe7
......@@ -6,10 +6,6 @@
__all__ = ['map']
try:
from itertools import imap
map = imap
except ImportError:
map = map
map = map
# vim: set sts=4 sw=4 ts=8 expandtab ft=python:
......@@ -4,8 +4,6 @@
""" CCTools Debugging module """
from __future__ import print_function
__all__ = ['set_name', 'set_file', 'set_flag', 'print_flags', 'clear_flags']
from _cctools import debug_config, debug_config_file, debug_config_file_size
......
......@@ -4,7 +4,7 @@
""" cctools Makeflow dag module """
from __future__ import print_function
from cctools.compat import map
from cctools.error import raise_parser_error, ParserError
......@@ -82,7 +82,7 @@ class DAG(object):
self.exports.update(line.split()[1:])
def parse_node(self, line):
output_files, input_files = map(lambda s: set(shlex.split(s)), line.split(':'))
output_files, input_files = [set(shlex.split(s)) for s in line.split(':')]
command = None
symbol = None
variables = []
......
......@@ -4,7 +4,7 @@
""" cctools Makeflow log module """
from __future__ import print_function
from cctools.compat import map
from cctools.error import raise_parser_error, ParserError
......@@ -572,7 +572,7 @@ class Reporter(object):
if sort_field:
log.nodes.sort(key=operator.attrgetter(sort_field))
if filters:
nodes = filter(lambda node: all(map(lambda f: eval(f, {'node': node}), filters)), log.nodes)
nodes = [node for node in log.nodes if all([eval(f, {'node': node}) for f in filters])]
else:
nodes = log.nodes
......@@ -662,7 +662,7 @@ class JSONReporter(Reporter):
if sort_field:
log.nodes.sort(key=operator.attrgetter(sort_field))
if filters:
nodes = filter(lambda node: all(map(lambda f: eval(f, {'node': node}), filters)), log.nodes)
nodes = [node for node in log.nodes if all([eval(f, {'node': node}) for f in filters])]
else:
nodes = log.nodes
......
......@@ -4,8 +4,8 @@
""" CCTools Plotting module """
from __future__ import print_function
from __future__ import with_statement
import os
......@@ -62,7 +62,7 @@ def gnuplot(plot_path, data_path, plot_format=None, plot_fields=None, **kwargs):
with open(script_path, 'w+') as fs:
print('set output "{0}"'.format(plot_path), file=fs)
for key, value in kwargs.items():
for key, value in list(kwargs.items()):
if key in GNUPLOT_STRING_FIELDS:
print('set {0} "{1}"'.format(key, value), file=fs)
else:
......
......@@ -4,7 +4,7 @@
""" CCTools Utility module """
from __future__ import print_function
from cctools.compat import map
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment