Show More
@@ -11,12 +11,16 from IPython.gui.wx.ipython_view import IPShellWidget | |||
|
11 | 11 | from IPython.gui.wx.ipython_history import IPythonHistoryPanel |
|
12 | 12 | |
|
13 | 13 | #used to invoke ipython1 wx implementation |
|
14 | from IPython.frontend.wx.ipythonx import IPythonXController | |
|
14 | is_sync_frontend_ok = True | |
|
15 | try: | |
|
16 | from IPython.frontend.wx.ipythonx import IPythonXController | |
|
17 | except ImportError: | |
|
18 | is_sync_frontend_ok = False | |
|
15 | 19 | |
|
16 | 20 | #used to create options.conf file in user directory |
|
17 | 21 | from IPython.ipapi import get |
|
18 | 22 | |
|
19 | __version__ = 0.9 | |
|
23 | __version__ = 0.91 | |
|
20 | 24 | __author__ = "Laurent Dufrechou" |
|
21 | 25 | __email__ = "laurent.dufrechou _at_ gmail.com" |
|
22 | 26 | __license__ = "BSD" |
@@ -30,7 +34,7 class MyFrame(wx.Frame): | |||
|
30 | 34 | application with movables windows""" |
|
31 | 35 | def __init__(self, parent=None, id=-1, title="WxIPython", |
|
32 | 36 | pos=wx.DefaultPosition, |
|
33 | size=(800, 600), style=wx.DEFAULT_FRAME_STYLE): | |
|
37 | size=(800, 600), style=wx.DEFAULT_FRAME_STYLE, sync_ok=False): | |
|
34 | 38 | wx.Frame.__init__(self, parent, id, title, pos, size, style) |
|
35 | 39 | self._mgr = wx.aui.AuiManager() |
|
36 | 40 | |
@@ -43,9 +47,11 class MyFrame(wx.Frame): | |||
|
43 | 47 | self.history_panel.setOptionTrackerHook(self.optionSave) |
|
44 | 48 | |
|
45 | 49 | self.ipython_panel = IPShellWidget(self,background_color = "BLACK") |
|
46 | self.ipython_panel2 = IPythonXController(self) | |
|
47 | 50 | #self.ipython_panel = IPShellWidget(self,background_color = "WHITE") |
|
48 | ||
|
51 | if(sync_ok): | |
|
52 | self.ipython_panel2 = IPythonXController(self) | |
|
53 | else: | |
|
54 | self.ipython_panel2 = None | |
|
49 | 55 | self.ipython_panel.setHistoryTrackerHook(self.history_panel.write) |
|
50 | 56 | self.ipython_panel.setStatusTrackerHook(self.updateStatus) |
|
51 | 57 | self.ipython_panel.setAskExitHandler(self.OnExitDlg) |
@@ -64,7 +70,8 class MyFrame(wx.Frame): | |||
|
64 | 70 | # main panels |
|
65 | 71 | self._mgr.AddPane(self.nb , wx.CENTER, "IPython Shells") |
|
66 | 72 | self.nb.AddPage(self.ipython_panel , "IPython0 Shell") |
|
67 | self.nb.AddPage(self.ipython_panel2, "IPython1 Synchroneous Shell") | |
|
73 | if(sync_ok): | |
|
74 | self.nb.AddPage(self.ipython_panel2, "IPython1 Synchroneous Shell") | |
|
68 | 75 | |
|
69 | 76 | self._mgr.AddPane(self.history_panel , wx.RIGHT, "IPython history") |
|
70 | 77 | |
@@ -237,20 +244,20 class MyFrame(wx.Frame): | |||
|
237 | 244 | #----------------------------------------- |
|
238 | 245 | class MyApp(wx.PySimpleApp): |
|
239 | 246 | """Creating our application""" |
|
240 | def __init__(self): | |
|
247 | def __init__(self, sync_ok=False): | |
|
241 | 248 | wx.PySimpleApp.__init__(self) |
|
242 | 249 | |
|
243 | self.frame = MyFrame() | |
|
250 | self.frame = MyFrame(sync_ok=sync_ok) | |
|
244 | 251 | self.frame.Show() |
|
245 | 252 | |
|
246 | 253 | #----------------------------------------- |
|
247 | 254 | #Main loop |
|
248 | 255 | #----------------------------------------- |
|
249 | def main(): | |
|
250 | app = MyApp() | |
|
256 | def main(sync_ok): | |
|
257 | app = MyApp(sync_ok) | |
|
251 | 258 | app.SetTopWindow(app.frame) |
|
252 | 259 | app.MainLoop() |
|
253 | 260 | |
|
254 | 261 | #if launched as main program run this |
|
255 | 262 | if __name__ == '__main__': |
|
256 | main() | |
|
263 | main(is_sync_frontend_ok) |
General Comments 0
You need to be logged in to leave comments.
Login now