mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-8231: Call idlelib.IdleConf.GetUserCfgDir only once. (#2629)
This commit is contained in:
parent
24f2e19d68
commit
223c7e70e4
4 changed files with 8 additions and 7 deletions
|
@ -172,10 +172,10 @@ class IdleConf:
|
||||||
"Populate default and user config parser dictionaries."
|
"Populate default and user config parser dictionaries."
|
||||||
#build idle install path
|
#build idle install path
|
||||||
if __name__ != '__main__': # we were imported
|
if __name__ != '__main__': # we were imported
|
||||||
idleDir=os.path.dirname(__file__)
|
idleDir = os.path.dirname(__file__)
|
||||||
else: # we were exec'ed (for testing only)
|
else: # we were exec'ed (for testing only)
|
||||||
idleDir=os.path.abspath(sys.path[0])
|
idleDir = os.path.abspath(sys.path[0])
|
||||||
userDir=self.GetUserCfgDir()
|
self.userdir = userDir = self.GetUserCfgDir()
|
||||||
|
|
||||||
defCfgFiles = {}
|
defCfgFiles = {}
|
||||||
usrCfgFiles = {}
|
usrCfgFiles = {}
|
||||||
|
|
|
@ -103,8 +103,8 @@ class EditorWindow(object):
|
||||||
self.tkinter_vars = {} # keys: Tkinter event names
|
self.tkinter_vars = {} # keys: Tkinter event names
|
||||||
# values: Tkinter variable instances
|
# values: Tkinter variable instances
|
||||||
self.top.instance_dict = {}
|
self.top.instance_dict = {}
|
||||||
self.recent_files_path = os.path.join(idleConf.GetUserCfgDir(),
|
self.recent_files_path = os.path.join(
|
||||||
'recent-files.lst')
|
idleConf.userdir, 'recent-files.lst')
|
||||||
self.text_frame = text_frame = Frame(top)
|
self.text_frame = text_frame = Frame(top)
|
||||||
self.vbar = vbar = Scrollbar(text_frame, name='vbar')
|
self.vbar = vbar = Scrollbar(text_frame, name='vbar')
|
||||||
self.width = idleConf.GetOption('main', 'EditorWindow',
|
self.width = idleConf.GetOption('main', 'EditorWindow',
|
||||||
|
|
|
@ -117,8 +117,8 @@ class PyShellEditorWindow(EditorWindow):
|
||||||
self.text.bind("<<clear-breakpoint-here>>", self.clear_breakpoint_here)
|
self.text.bind("<<clear-breakpoint-here>>", self.clear_breakpoint_here)
|
||||||
self.text.bind("<<open-python-shell>>", self.flist.open_shell)
|
self.text.bind("<<open-python-shell>>", self.flist.open_shell)
|
||||||
|
|
||||||
self.breakpointPath = os.path.join(idleConf.GetUserCfgDir(),
|
self.breakpointPath = os.path.join(
|
||||||
'breakpoints.lst')
|
idleConf.userdir, 'breakpoints.lst')
|
||||||
# whenever a file is changed, restore breakpoints
|
# whenever a file is changed, restore breakpoints
|
||||||
def filename_changed_hook(old_hook=self.io.filename_change_hook,
|
def filename_changed_hook(old_hook=self.io.filename_change_hook,
|
||||||
self=self):
|
self=self):
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
IDLE: call config.IdleConf.GetUserCfgDir only once.
|
Loading…
Add table
Add a link
Reference in a new issue