Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f4c0ed6
some changes to file reading
etiennerichart Jun 25, 2020
347707d
Some work on symbolic link files
etiennerichart Jun 26, 2020
3f13a28
Cleaned up symlink fix ideas
etiennerichart Jun 26, 2020
47ea5ee
More clean up
etiennerichart Jun 26, 2020
6eff3b2
Make it easier to test different methods
etiennerichart Jun 26, 2020
8e08f3a
Found an even better way. useNameSubname = 4
etiennerichart Jun 26, 2020
2b96e8d
"Used os.path.realpath to fix issue"
etiennerichart Jun 29, 2020
44f76f7
Removed code that I was using for testing
etiennerichart Jun 29, 2020
513f37d
Made variable to store paths for comparison.
etiennerichart Jun 30, 2020
01a6a4c
further finalize changes to importcompletion.py
etiennerichart Jul 3, 2020
2edc977
Working on test but am having issues with the try
etiennerichart Jul 6, 2020
62bed48
replaced import test file with them file directory
etiennerichart Jul 7, 2020
45ada74
fixed importtest.py
etiennerichart Jul 8, 2020
9fafb2e
moved and renamed importtest to test folder
etiennerichart Jul 8, 2020
52cef9f
cleaned up test file
etiennerichart Jul 9, 2020
6983428
improved test
etiennerichart Jul 9, 2020
5928198
made it so test skips in python 2
etiennerichart Jul 9, 2020
dbc1d4f
made skipping work
etiennerichart Jul 9, 2020
5f15d7d
removed chdir and made better test skip
etiennerichart Jul 13, 2020
8bd85e9
fix symbolic links for the test
etiennerichart Jul 16, 2020
0a29731
used black auto format
etiennerichart Jul 16, 2020
cec627a
improved test to work on other computers
etiennerichart Jul 16, 2020
629bf1e
made testing strickter
etiennerichart Jul 16, 2020
11369fc
further testing
etiennerichart Jul 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Found an even better way. useNameSubname = 4
  • Loading branch information
etiennerichart committed Jun 26, 2020
commit 8e08f3a7b963b36466449cc2e6b57f6df671b7d0
10 changes: 8 additions & 2 deletions bpython/importcompletion.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ def find_modules(path):
nameSubname = []

#Decides if you are using the first method: usng name subname (1),
# the second method: using pathname (2) or the original (3)
# the second method: using pathname (2) or the original (3), os.realpath
global useNameSubname
useNameSubname = 3
useNameSubname = 4
#print("useNameSubname:", useNameSubname)

if not os.path.isdir(path):
Expand Down Expand Up @@ -217,6 +217,12 @@ def find_modules(path):
pathGood = False
#print(pathGood)
#print()
elif useNameSubname == 4:
pathGood = True
pathReal = os.path.realpath(pathname)
if len(pathReal) < len(pathname) and pathReal in pathname:
#print("PathReal:", pathReal, "Path:", pathname)
pathGood = False
if useNameSubname == 1 or pathGood:
for subname in find_modules(pathname):
if subname != "__init__":
Expand Down