mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #27891: Consistently group and sort imports within idlelib modules.
This commit is contained in:
parent
89b1162511
commit
bfbaa6b206
47 changed files with 200 additions and 125 deletions
|
@ -1,10 +1,10 @@
|
|||
import importlib.machinery
|
||||
import os
|
||||
import sys
|
||||
import importlib.machinery
|
||||
|
||||
from idlelib.tree import TreeItem
|
||||
from idlelib.browser import ClassBrowser, ModuleBrowserTreeItem
|
||||
from idlelib.pyshell import PyShellFileList
|
||||
from idlelib.tree import TreeItem
|
||||
|
||||
|
||||
class PathBrowser(ClassBrowser):
|
||||
|
@ -24,6 +24,7 @@ class PathBrowser(ClassBrowser):
|
|||
def rootnode(self):
|
||||
return PathBrowserTreeItem()
|
||||
|
||||
|
||||
class PathBrowserTreeItem(TreeItem):
|
||||
|
||||
def GetText(self):
|
||||
|
@ -36,6 +37,7 @@ class PathBrowserTreeItem(TreeItem):
|
|||
sublist.append(item)
|
||||
return sublist
|
||||
|
||||
|
||||
class DirBrowserTreeItem(TreeItem):
|
||||
|
||||
def __init__(self, dir, packages=[]):
|
||||
|
@ -95,6 +97,7 @@ class DirBrowserTreeItem(TreeItem):
|
|||
sorted.sort()
|
||||
return sorted
|
||||
|
||||
|
||||
def _path_browser(parent): # htest #
|
||||
flist = PyShellFileList(parent)
|
||||
PathBrowser(flist, _htest=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue