FIXED: ngspice AC simulation
[oscopy.git] / ioscopy_app.py
blob429544f65b30ad05171e12ee65ecd7a600c25e12
1 #!/usr/bin/python2
2 #-*-Shell-*-
3 #if [[ ! -e ${HOME}/.ipython/ipythonrc-oscopy ]]; then
4 # cp @datarootdir@/oscopy/ipythonrc-oscopy ${HOME}/.ipython
5 #fi
6 #ipython -pylab -profile oscopy -noconfirm_exit -nobanner
8 GETTEXT_DOMAIN = 'oscopy'
9 import gettext
11 import gtk, gobject, sys, os, shutil
12 import IPython.Shell
13 live = False
15 gettext.install(GETTEXT_DOMAIN,'@datarootdir@/locale',unicode=1)
17 try:
18 os.stat(os.getenv('HOME') + '/.ipython/ipythonrc-oscopy')
19 except OSError, e:
20 os.symlink('@datarootdir@/oscopy/ipythonrc-oscopy', os.getenv('HOME') + '/.ipython/ipythonrc-oscopy')
22 def run_ipython():
23 global live
24 if live:
25 return False
27 live = True
28 shell = IPython.Shell.IPShell(argv=['-profile','oscopy','-noconfirm_exit','-nobanner'])
29 IPython.Shell.hijack_gtk()
30 shell.mainloop()
31 gtk.main_quit()
32 sys.exit()
34 gobject.idle_add(run_ipython)
35 gtk.set_interactive(True)
36 gtk.main()