-
Notifications
You must be signed in to change notification settings - Fork 3
/
__init__.py
executable file
·54 lines (50 loc) · 1.46 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#coding=utf-8
__all__=['U','T','N','F','py']
# import sys
# for i in __all__:
# if i in sys.modules:
# sys.modules['_'+i]=sys.modules.pop(i)
# try:exec('import '+i)
# except Exception as ei:
# if 'gError' in dir():gError.append(ei)
# else:gError=[ei]
# __all__.remove(i)
try:
try:from . import py
except:import py
U=py.importU()
if U.isipy():
__all__.append('ipy')
# import ipy
# ipy.gipy.autocall=2# 放到 qgb.ipy中
# ipy.gi.setModule()
# U.replaceModule('ipy',ipy.gi,package='qgb',backup=False)
# ipy=ipy.gi#少了这个,ipy在sys.modules 中虽然已经替换,但是实际使用却还是原来module ,?
# ipy.startRecord()
# M:\Program Files\.babun\cygwin\home\qgb\.ipython\profile_default\history.sqlite
if U.iswin() or (py.is2() and U.iscyg() ):
__all__.append('Win')
# U.pln( __all__
except Exception as e:
if 'gError' in dir():gError.append(e)
else:gError=[e]
# U.pln( __name__
# sys.argv==['-c']
# U.repl()
# if __name__=='__main__': #此句在 python -m qgb中不会执行,始终为'qgb', why? #TODO #TOKNOW
# U.pln( __all__
# try:
# f=sys._getframe()
# while f and f.f_globals and 'get_ipython' not in f.f_globals.keys():
# f=f.f_back
# ipy=f.f_globals['get_ipython']()
# ipy.autocall=2
# except Exception as e:
# pass
# U.pln( e
'''
ipdb> !__import__('qgb.U').U.npp(self.handle)
<subprocess.Popen object at 0x00000283E707DE08>
ipdb> !__import__('qgb').U.npp(self.handle)
<subprocess.Popen object at 0x00000283E743B1C8>
'''