##// END OF EJS Templates
more IPShellQt* cleanup
darren.dale -
Show More
@@ -4,7 +4,7 b''
4 4 All the matplotlib support code was co-developed with John Hunter,
5 5 matplotlib's author.
6 6
7 $Id: Shell.py 2756 2007-09-10 18:25:30Z darren.dale $"""
7 $Id: Shell.py 2758 2007-09-10 20:56:27Z darren.dale $"""
8 8
9 9 #*****************************************************************************
10 10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
@@ -885,32 +885,6 b' class IPShellQt(IPThread):'
885 885
886 886 import qt
887 887
888 self.qApp = qt.qApp
889
890 class DummyQApp:
891 def __init__(self, *args):
892 self.qApp = qt.qApp
893
894 def exec_loop(*args, **kwargs):
895 pass
896
897 def __getattr__(self, name):
898 return getattr(self.qApp, name)
899
900 class DummyQApplication:
901 def __init__(self):
902 self.QApplication = qt.QApplication
903
904 def __call__(*args, **kwargs):
905 # mask until module NoneType errors can be fixed
906 # return DummyQApp()
907 return qt.qApp
908
909 def __getattr__( self, name ):
910 return getattr(self.QApplication, name)
911
912 qt.QApplication = DummyQApplication()
913
914 888 # Allows us to use both Tk and QT.
915 889 self.tk = get_tk()
916 890
@@ -935,9 +909,7 b' class IPShellQt(IPThread):'
935 909 self._banner = banner
936 910
937 911 if qt.QApplication.startingUp():
938 self.qApp = qt.QApplication.QApplication(sys.argv)
939 # mask until module NoneType errors can be fixed
940 # qt.qApp = qt.QApplication()
912 self.qApp = qt.QApplication(sys.argv)
941 913
942 914 self.timer = qt.QTimer()
943 915 qt.QObject.connect(self.timer,
@@ -948,7 +920,7 b' class IPShellQt(IPThread):'
948 920 self.timer.start(self.TIMEOUT, True)
949 921 while True:
950 922 if self.IP._kill: break
951 self.qApp.exec_loop()
923 qt.qApp.exec_loop()
952 924 self.join()
953 925
954 926 def on_timer(self):
@@ -957,7 +929,6 b' class IPShellQt(IPThread):'
957 929 self.timer.start(self.TIMEOUT, True)
958 930 return result
959 931
960
961 932 class IPShellQt4(IPThread):
962 933 """Run a Qt event loop in a separate thread.
963 934
@@ -972,32 +943,6 b' class IPShellQt4(IPThread):'
972 943
973 944 from PyQt4 import QtCore, QtGui
974 945
975 self.qApp = QtGui.qApp
976
977 class DummyQApp:
978 def __init__(self, *args):
979 self.qApp = QtGui.qApp
980
981 def exec_(*args, **kwargs):
982 pass
983
984 def __getattr__(self, name):
985 return getattr(self.qApp, name)
986
987 class DummyQApplication:
988 def __init__(self, *args):
989 self.QApplication = QtGui.QApplication
990
991 def __call__(*args, **kwargs):
992 # mask until module NoneType errors can be fixed
993 # return DummyQApp()
994 return QtGui.qApp
995
996 def __getattr__(self, name):
997 return getattr(self.QApplication, name)
998
999 QtGui.QApplication = DummyQApplication()
1000
1001 946 # Allows us to use both Tk and QT.
1002 947 self.tk = get_tk()
1003 948
@@ -1022,9 +967,7 b' class IPShellQt4(IPThread):'
1022 967 self._banner = banner
1023 968
1024 969 if QtGui.QApplication.startingUp():
1025 self.qApp = QtGui.QApplication.QApplication(sys.argv)
1026 # mask until module NoneType errors can be fixed
1027 # QtGui.qApp = QtGui.QApplication()
970 self.qApp = QtGui.QApplication(sys.argv)
1028 971
1029 972 self.timer = QtCore.QTimer()
1030 973 QtCore.QObject.connect(self.timer,
@@ -1034,8 +977,8 b' class IPShellQt4(IPThread):'
1034 977 self.start()
1035 978 self.timer.start(self.TIMEOUT)
1036 979 while True:
1037 self.qApp.exec_()
1038 980 if self.IP._kill: break
981 QtGui.qApp.exec_()
1039 982 self.join()
1040 983
1041 984 def on_timer(self):
General Comments 0
You need to be logged in to leave comments. Login now