Show More
@@ -2,7 +2,7 b'' | |||
|
2 | 2 | # -*- coding: iso-8859-15 -*- |
|
3 | 3 | |
|
4 | 4 | import wx.aui |
|
5 | ||
|
5 | import sys | |
|
6 | 6 | #used for about dialog |
|
7 | 7 | from wx.lib.wordwrap import wordwrap |
|
8 | 8 | |
@@ -10,6 +10,9 b' from wx.lib.wordwrap import wordwrap' | |||
|
10 | 10 | from IPython.gui.wx.ipython_view import IPShellWidget |
|
11 | 11 | from IPython.gui.wx.ipython_history import IPythonHistoryPanel |
|
12 | 12 | |
|
13 | #used to create options.conf file in user directory | |
|
14 | from IPython.ipapi import get | |
|
15 | ||
|
13 | 16 | __version__ = 0.8 |
|
14 | 17 | __author__ = "Laurent Dufrechou" |
|
15 | 18 | __email__ = "laurent.dufrechou _at_ gmail.com" |
@@ -84,7 +87,9 b' class MyFrame(wx.Frame):' | |||
|
84 | 87 | dlg.Destroy() |
|
85 | 88 | |
|
86 | 89 | def optionSave(self, name, value): |
|
87 | opt = open('options.conf','w') | |
|
90 | ip = get() | |
|
91 | path = ip.IP.rc.ipythondir | |
|
92 | opt = open(path + '/options.conf','w') | |
|
88 | 93 | |
|
89 | 94 | try: |
|
90 | 95 | options_ipython_panel = self.ipython_panel.getOptions() |
@@ -98,24 +103,31 b' class MyFrame(wx.Frame):' | |||
|
98 | 103 | opt.close() |
|
99 | 104 | |
|
100 | 105 | def optionLoad(self): |
|
101 | opt = open('options.conf','r') | |
|
102 | lines = opt.readlines() | |
|
103 | opt.close() | |
|
106 | try: | |
|
107 | ip = get() | |
|
108 | path = ip.IP.rc.ipythondir | |
|
109 | opt = open(path + '/options.conf','r') | |
|
110 | lines = opt.readlines() | |
|
111 | opt.close() | |
|
104 | 112 | |
|
105 | options_ipython_panel = self.ipython_panel.getOptions() | |
|
106 | options_history_panel = self.history_panel.getOptions() | |
|
107 | ||
|
108 | for line in lines: | |
|
109 | key = line.split('=')[0] | |
|
110 | value = line.split('=')[1].replace('\n','').replace('\r','') | |
|
111 | if key in options_ipython_panel.keys(): | |
|
112 | options_ipython_panel[key]['value'] = value | |
|
113 | elif key in options_history_panel.keys(): | |
|
114 | options_history_panel[key]['value'] = value | |
|
115 | else: | |
|
116 | print >>sys.__stdout__,"Warning: key ",key,"not found in widget options. Check Options.conf" | |
|
117 | self.ipython_panel.reloadOptions(options_ipython_panel) | |
|
118 | self.history_panel.reloadOptions(options_history_panel) | |
|
113 | options_ipython_panel = self.ipython_panel.getOptions() | |
|
114 | options_history_panel = self.history_panel.getOptions() | |
|
115 | ||
|
116 | for line in lines: | |
|
117 | key = line.split('=')[0] | |
|
118 | value = line.split('=')[1].replace('\n','').replace('\r','') | |
|
119 | if key in options_ipython_panel.keys(): | |
|
120 | options_ipython_panel[key]['value'] = value | |
|
121 | elif key in options_history_panel.keys(): | |
|
122 | options_history_panel[key]['value'] = value | |
|
123 | else: | |
|
124 | print >>sys.__stdout__,"Warning: key ",key,"not found in widget options. Check Options.conf" | |
|
125 | self.ipython_panel.reloadOptions(options_ipython_panel) | |
|
126 | self.history_panel.reloadOptions(options_history_panel) | |
|
127 | ||
|
128 | except IOError: | |
|
129 | print >>sys.__stdout__,"Could not open Options.conf, defaulting to default values." | |
|
130 | ||
|
119 | 131 | |
|
120 | 132 | def createMenu(self): |
|
121 | 133 | """local method used to create one menu bar""" |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now