📄 __init__.py
字号:
## A base hack to allow ming use in Zope.#from AccessControl import allow_module, allow_class, allow_typefrom AccessControl import ModuleSecurityInfo, ClassSecurityInfofrom Globals import InitializeClassfrom thread import allocate_lockZMingLock = allocate_lock()allow_module('ming')import setFlags__allow_access_to_unprotected_subobjects__=1import osZWIFF_DEBUG = os.environ.get('ZWIFF_DEBUG',0) and 1class MingLocker: debug = ZWIFF_DEBUG def __init__(self): if self.debug: print "attempting to get lock.. " ZMingLock.acquire() if self.debug: print "got lock.. " def __del__(self): if self.debug: print "attempting to release lock.. " ZMingLock.release() if self.debug: print "lock released.. "import tempfileimport osclass dumbBuffer: __allow_access_to_unprotected_subobjects__=1 debug = ZWIFF_DEBUG def __init__(self, ext='', tmpdir=''): self.f = None if tmpdir: tempfile.tempdir=tmpdir self.tmpfile = tempfile.mktemp() if ext: self.tmpfile = self.tmpfile + ext def filename(self): return self.tmpfile def write(self, s): f = open(self.tmpfile,'w') f.write(s) f.close() def read(self): f = open(self.tmpfile) s = f.read() f.close() return s def __del__(self): if not ZWIFF_DEBUG: os.unlink(self.tmpfile)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -