pyflyby 1.9.2__tar.gz → 1.9.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyflyby might be problematic. Click here for more details.
- {pyflyby-1.9.2/lib/python/pyflyby.egg-info → pyflyby-1.9.3}/PKG-INFO +1 -1
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_comms.py +2 -3
- {pyflyby-1.9.2/lib/python → pyflyby-1.9.3/bin}/pyflyby/_flags.py +1 -1
- {pyflyby-1.9.2/lib/python → pyflyby-1.9.3/bin}/pyflyby/_importclns.py +1 -2
- {pyflyby-1.9.2/lib/python → pyflyby-1.9.3/bin}/pyflyby/_importdb.py +1 -2
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_interactive.py +6 -4
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_livepatch.py +1 -1
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_log.py +1 -1
- {pyflyby-1.9.2/lib/python → pyflyby-1.9.3/bin}/pyflyby/_version.py +1 -1
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/tidy-imports +5 -7
- {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/std.py +1 -1
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_comms.py +2 -3
- {pyflyby-1.9.2/bin → pyflyby-1.9.3/lib/python}/pyflyby/_flags.py +1 -1
- {pyflyby-1.9.2/bin → pyflyby-1.9.3/lib/python}/pyflyby/_importclns.py +1 -2
- {pyflyby-1.9.2/bin → pyflyby-1.9.3/lib/python}/pyflyby/_importdb.py +1 -2
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_interactive.py +6 -4
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_livepatch.py +1 -1
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_log.py +1 -1
- {pyflyby-1.9.2/bin → pyflyby-1.9.3/lib/python}/pyflyby/_version.py +1 -1
- {pyflyby-1.9.2 → pyflyby-1.9.3/lib/python/pyflyby.egg-info}/PKG-INFO +1 -1
- {pyflyby-1.9.2 → pyflyby-1.9.3}/.pyflyby +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/LICENSE.txt +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/MANIFEST.in +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/README.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/autoipython +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/autopython +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/collect-exports +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/collect-imports +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/create-imports +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/find-import +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/list-bad-xrefs +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/prune-broken-imports +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/__init__.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/__main__.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_autoimp.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_cmdline.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_dbg.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_docxref.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_file.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_format.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_idents.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_imports2s.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_importstmt.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_modules.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_parse.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_py.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/_util.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/autoimport.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby/importdb.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/pyflyby-diff +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/reformat-imports +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/replace-star-imports +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/bin/transform-imports +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/LICENSE.txt +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/Makefile +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/TODO.txt +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/__init__.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/api.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/autoimp.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/cmdline.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/comms.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/dbg.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/file.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/flags.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/format.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/idents.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/importclns.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/importdb.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/imports2s.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/importstmt.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/interactive.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/livepatch.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/log.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/modules.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/parse.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/py.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/api/util.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/autoipython.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/cli.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/collect_exports.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/collect_imports.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/find_import.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/prune_broken_imports.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/py.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/pyflyby_diff.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/reformat_imports.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/replace_star_imports.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/tidy_imports.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/cli/transform_imports.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/conf.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/index.rst +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/make.bat +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/doc/testing.txt +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/canonical.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/common.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/forget.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/mandatory.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/etc/pyflyby/numpy.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/emacs/pyflyby.el +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/__init__.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/__main__.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_autoimp.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_cmdline.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_dbg.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_docxref.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_file.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_format.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_idents.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_imports2s.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_importstmt.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_modules.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_parse.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_py.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/_util.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/autoimport.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby/importdb.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby.egg-info/SOURCES.txt +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby.egg-info/dependency_links.txt +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby.egg-info/entry_points.txt +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby.egg-info/requires.txt +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/lib/python/pyflyby.egg-info/top_level.txt +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/libexec/pyflyby/colordiff +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/libexec/pyflyby/diff-colorize +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/setup.cfg +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/setup.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/__init__.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_0testconfig.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_autoimp.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_cmdline.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_docxref.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_file.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_flags.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_format.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_idents.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_importclns.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_importdb.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_imports2s.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_importstmt.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_interactive.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_jupyterlab_pyflyby.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_livepatch.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_modules.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_parse.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_py.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/test_util.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/tests_sorts.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tests/xrefs.py +0 -0
- {pyflyby-1.9.2 → pyflyby-1.9.3}/tox.ini +0 -0
|
@@ -8,7 +8,6 @@ from pyflyby._imports2s import (SourceToSourceFileImportsTransformation,
|
|
|
8
8
|
reformat_import_statements)
|
|
9
9
|
from pyflyby._importstmt import Import
|
|
10
10
|
from pyflyby._log import logger
|
|
11
|
-
import six
|
|
12
11
|
|
|
13
12
|
# These are comm targets that the frontend (lab/notebook) is expected to
|
|
14
13
|
# open. At this point, we handle only missing imports and
|
|
@@ -67,7 +66,7 @@ def initialize_comms():
|
|
|
67
66
|
|
|
68
67
|
|
|
69
68
|
def remove_comms():
|
|
70
|
-
for target_name, comm in
|
|
69
|
+
for target_name, comm in comms.items():
|
|
71
70
|
comm.close()
|
|
72
71
|
logger.debug("Closing comm for " + target_name)
|
|
73
72
|
|
|
@@ -87,7 +86,7 @@ def send_comm_message(target_name, msg):
|
|
|
87
86
|
|
|
88
87
|
def comm_close_handler(comm, message):
|
|
89
88
|
comm_id = message["comm_id"]
|
|
90
|
-
for target, comm in
|
|
89
|
+
for target, comm in comms.keys():
|
|
91
90
|
if comm.comm_id == comm_id:
|
|
92
91
|
comms.pop(target)
|
|
93
92
|
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
from collections import defaultdict
|
|
8
8
|
from functools import total_ordering
|
|
9
|
-
import six
|
|
10
9
|
|
|
11
10
|
from pyflyby._flags import CompilerFlags
|
|
12
11
|
from pyflyby._idents import dotted_prefixes, is_identifier
|
|
@@ -567,7 +566,7 @@ class ImportMap(object):
|
|
|
567
566
|
return self._data.items()
|
|
568
567
|
|
|
569
568
|
def iterkeys(self):
|
|
570
|
-
return
|
|
569
|
+
return iter(self._data.keys())
|
|
571
570
|
|
|
572
571
|
def keys(self):
|
|
573
572
|
return self._data.keys()
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
from collections import defaultdict
|
|
8
8
|
import os
|
|
9
9
|
import re
|
|
10
|
-
import six
|
|
11
10
|
|
|
12
11
|
from pyflyby._file import Filename, expand_py_files_from_args, UnsafeFilenameError
|
|
13
12
|
from pyflyby._idents import dotted_prefixes
|
|
@@ -560,7 +559,7 @@ class ImportDB(object):
|
|
|
560
559
|
for prefix in dotted_prefixes(imp.fullname)[:-1]:
|
|
561
560
|
d[prefix].add(Import.from_parts(prefix, prefix))
|
|
562
561
|
return dict( (k, tuple(sorted(v - set(self.forget_imports.imports))))
|
|
563
|
-
for k, v in
|
|
562
|
+
for k, v in d.items())
|
|
564
563
|
|
|
565
564
|
def __repr__(self):
|
|
566
565
|
printed = self.pretty_print()
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
import ast
|
|
8
|
+
import builtins
|
|
8
9
|
from contextlib import contextmanager
|
|
9
10
|
import errno
|
|
10
11
|
import inspect
|
|
11
12
|
import os
|
|
13
|
+
import operator
|
|
12
14
|
import re
|
|
13
15
|
import subprocess
|
|
14
16
|
import sys
|
|
15
17
|
|
|
16
|
-
import six
|
|
17
|
-
from six.moves import builtins
|
|
18
18
|
|
|
19
19
|
from pyflyby._autoimp import (LoadSymbolError, ScopeStack, auto_eval,
|
|
20
20
|
auto_import,
|
|
@@ -37,6 +37,8 @@ if False:
|
|
|
37
37
|
__original__ = None # for pyflakes
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
get_method_self = operator.attrgetter('__self__')
|
|
41
|
+
|
|
40
42
|
# TODO: also support arbitrary code (in the form of a lambda and/or
|
|
41
43
|
# assignment) as new way to do "lazy" creations, e.g. foo = a.b.c(d.e+f.g())
|
|
42
44
|
|
|
@@ -2098,7 +2100,7 @@ class AutoImporter(object):
|
|
|
2098
2100
|
# Tested with IPython 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 2.3, 2.4, 3.0,
|
|
2099
2101
|
# 3.1, 3.2, 4.0.
|
|
2100
2102
|
line_magics = ip.magics_manager.magics['line']
|
|
2101
|
-
execmgr =
|
|
2103
|
+
execmgr = get_method_self(line_magics['prun'])#.im_self
|
|
2102
2104
|
if hasattr(execmgr, "_run_with_profiler"):
|
|
2103
2105
|
@self._advise(execmgr._run_with_profiler)
|
|
2104
2106
|
def run_with_profiler_with_autoimport(code, opts, namespace):
|
|
@@ -2303,7 +2305,7 @@ class AutoImporter(object):
|
|
|
2303
2305
|
# Tested with IPython 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 2.3, 2.4, 3.0,
|
|
2304
2306
|
# 3.1, 3.2, 4.0, 5.8.
|
|
2305
2307
|
line_magics = ip.magics_manager.magics['line']
|
|
2306
|
-
execmgr =
|
|
2308
|
+
execmgr = get_method_self(line_magics['debug'])
|
|
2307
2309
|
if hasattr(execmgr, "_run_with_debugger"):
|
|
2308
2310
|
@self._advise(execmgr._run_with_debugger)
|
|
2309
2311
|
def run_with_debugger_with_autoimport(code, code_ns,
|
|
@@ -27,7 +27,7 @@ from pyflyby._cmdline import hfmt, parse_args, process_actions
|
|
|
27
27
|
from pyflyby._imports2s import (canonicalize_imports,
|
|
28
28
|
fix_unused_and_missing_imports,
|
|
29
29
|
replace_star_imports,
|
|
30
|
-
transform_imports
|
|
30
|
+
transform_imports)
|
|
31
31
|
|
|
32
32
|
import toml
|
|
33
33
|
TOML_AVAIL = True
|
|
@@ -156,13 +156,11 @@ def main():
|
|
|
156
156
|
)
|
|
157
157
|
# TODO: disable sorting until we figure out #287
|
|
158
158
|
# https://github.com/deshaw/pyflyby/issues/287
|
|
159
|
-
#
|
|
160
|
-
|
|
159
|
+
# from pyflyby._imports2s import sort_imports
|
|
160
|
+
# x = sort_imports(x)
|
|
161
161
|
if options.canonicalize:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
cannonical_imports = sort_imports
|
|
165
|
-
return cannonical_imports
|
|
162
|
+
x = canonicalize_imports(x, params=options.params)
|
|
163
|
+
return x
|
|
166
164
|
process_actions(args, options.actions, modify)
|
|
167
165
|
|
|
168
166
|
|
|
@@ -148,7 +148,7 @@ from six.moves import (builtins, cPickle, configparser,
|
|
|
148
148
|
email_mime_image, email_mime_multipart,
|
|
149
149
|
email_mime_text, http_client, map,
|
|
150
150
|
queue, zip)
|
|
151
|
-
from
|
|
151
|
+
from urllib.parse import urlencode
|
|
152
152
|
from six.moves.urllib.request import urlopen
|
|
153
153
|
import smtplib
|
|
154
154
|
from smtplib import (SMTP, SMTPAuthenticationError,
|
|
@@ -8,7 +8,6 @@ from pyflyby._imports2s import (SourceToSourceFileImportsTransformation,
|
|
|
8
8
|
reformat_import_statements)
|
|
9
9
|
from pyflyby._importstmt import Import
|
|
10
10
|
from pyflyby._log import logger
|
|
11
|
-
import six
|
|
12
11
|
|
|
13
12
|
# These are comm targets that the frontend (lab/notebook) is expected to
|
|
14
13
|
# open. At this point, we handle only missing imports and
|
|
@@ -67,7 +66,7 @@ def initialize_comms():
|
|
|
67
66
|
|
|
68
67
|
|
|
69
68
|
def remove_comms():
|
|
70
|
-
for target_name, comm in
|
|
69
|
+
for target_name, comm in comms.items():
|
|
71
70
|
comm.close()
|
|
72
71
|
logger.debug("Closing comm for " + target_name)
|
|
73
72
|
|
|
@@ -87,7 +86,7 @@ def send_comm_message(target_name, msg):
|
|
|
87
86
|
|
|
88
87
|
def comm_close_handler(comm, message):
|
|
89
88
|
comm_id = message["comm_id"]
|
|
90
|
-
for target, comm in
|
|
89
|
+
for target, comm in comms.keys():
|
|
91
90
|
if comm.comm_id == comm_id:
|
|
92
91
|
comms.pop(target)
|
|
93
92
|
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
from collections import defaultdict
|
|
8
8
|
from functools import total_ordering
|
|
9
|
-
import six
|
|
10
9
|
|
|
11
10
|
from pyflyby._flags import CompilerFlags
|
|
12
11
|
from pyflyby._idents import dotted_prefixes, is_identifier
|
|
@@ -567,7 +566,7 @@ class ImportMap(object):
|
|
|
567
566
|
return self._data.items()
|
|
568
567
|
|
|
569
568
|
def iterkeys(self):
|
|
570
|
-
return
|
|
569
|
+
return iter(self._data.keys())
|
|
571
570
|
|
|
572
571
|
def keys(self):
|
|
573
572
|
return self._data.keys()
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
from collections import defaultdict
|
|
8
8
|
import os
|
|
9
9
|
import re
|
|
10
|
-
import six
|
|
11
10
|
|
|
12
11
|
from pyflyby._file import Filename, expand_py_files_from_args, UnsafeFilenameError
|
|
13
12
|
from pyflyby._idents import dotted_prefixes
|
|
@@ -560,7 +559,7 @@ class ImportDB(object):
|
|
|
560
559
|
for prefix in dotted_prefixes(imp.fullname)[:-1]:
|
|
561
560
|
d[prefix].add(Import.from_parts(prefix, prefix))
|
|
562
561
|
return dict( (k, tuple(sorted(v - set(self.forget_imports.imports))))
|
|
563
|
-
for k, v in
|
|
562
|
+
for k, v in d.items())
|
|
564
563
|
|
|
565
564
|
def __repr__(self):
|
|
566
565
|
printed = self.pretty_print()
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
import ast
|
|
8
|
+
import builtins
|
|
8
9
|
from contextlib import contextmanager
|
|
9
10
|
import errno
|
|
10
11
|
import inspect
|
|
11
12
|
import os
|
|
13
|
+
import operator
|
|
12
14
|
import re
|
|
13
15
|
import subprocess
|
|
14
16
|
import sys
|
|
15
17
|
|
|
16
|
-
import six
|
|
17
|
-
from six.moves import builtins
|
|
18
18
|
|
|
19
19
|
from pyflyby._autoimp import (LoadSymbolError, ScopeStack, auto_eval,
|
|
20
20
|
auto_import,
|
|
@@ -37,6 +37,8 @@ if False:
|
|
|
37
37
|
__original__ = None # for pyflakes
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
get_method_self = operator.attrgetter('__self__')
|
|
41
|
+
|
|
40
42
|
# TODO: also support arbitrary code (in the form of a lambda and/or
|
|
41
43
|
# assignment) as new way to do "lazy" creations, e.g. foo = a.b.c(d.e+f.g())
|
|
42
44
|
|
|
@@ -2098,7 +2100,7 @@ class AutoImporter(object):
|
|
|
2098
2100
|
# Tested with IPython 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 2.3, 2.4, 3.0,
|
|
2099
2101
|
# 3.1, 3.2, 4.0.
|
|
2100
2102
|
line_magics = ip.magics_manager.magics['line']
|
|
2101
|
-
execmgr =
|
|
2103
|
+
execmgr = get_method_self(line_magics['prun'])#.im_self
|
|
2102
2104
|
if hasattr(execmgr, "_run_with_profiler"):
|
|
2103
2105
|
@self._advise(execmgr._run_with_profiler)
|
|
2104
2106
|
def run_with_profiler_with_autoimport(code, opts, namespace):
|
|
@@ -2303,7 +2305,7 @@ class AutoImporter(object):
|
|
|
2303
2305
|
# Tested with IPython 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 2.3, 2.4, 3.0,
|
|
2304
2306
|
# 3.1, 3.2, 4.0, 5.8.
|
|
2305
2307
|
line_magics = ip.magics_manager.magics['line']
|
|
2306
|
-
execmgr =
|
|
2308
|
+
execmgr = get_method_self(line_magics['debug'])
|
|
2307
2309
|
if hasattr(execmgr, "_run_with_debugger"):
|
|
2308
2310
|
@self._advise(execmgr._run_with_debugger)
|
|
2309
2311
|
def run_with_debugger_with_autoimport(code, code_ns,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|