| Index: third_party/logilab/common/fileutils.py
|
| ===================================================================
|
| --- third_party/logilab/common/fileutils.py (revision 292881)
|
| +++ third_party/logilab/common/fileutils.py (working copy)
|
| @@ -23,6 +23,9 @@
|
| write_open_mode, ensure_fs_mode, export
|
| :sort: path manipulation, file manipulation
|
| """
|
| +
|
| +from __future__ import print_function
|
| +
|
| __docformat__ = "restructuredtext en"
|
|
|
| import sys
|
| @@ -32,12 +35,11 @@
|
| from os.path import abspath
|
| from os import sep, mkdir, remove, listdir, stat, chmod, walk
|
| from stat import ST_MODE, S_IWRITE
|
| -from cStringIO import StringIO
|
|
|
| from logilab.common import STD_BLACKLIST as BASE_BLACKLIST, IGNORED_EXTENSIONS
|
| from logilab.common.shellutils import find
|
| from logilab.common.deprecation import deprecated
|
| -from logilab.common.compat import FileIO, any
|
| +from logilab.common.compat import FileIO
|
|
|
| def first_level_directory(path):
|
| """Return the first level directory of a path.
|
| @@ -375,7 +377,7 @@
|
| src = join(directory, filename)
|
| dest = to_dir + src[len(from_dir):]
|
| if verbose:
|
| - print >> sys.stderr, src, '->', dest
|
| + print(src, '->', dest, file=sys.stderr)
|
| if exists(dest):
|
| remove(dest)
|
| shutil.copy2(src, dest)
|
| @@ -397,6 +399,6 @@
|
| src = join(dirpath, filename)
|
| if islink(src) and not exists(src):
|
| if verbose:
|
| - print 'remove dead link', src
|
| + print('remove dead link', src)
|
| remove(src)
|
|
|
|
|