本文整理汇总了Python中org.python.core.Py.getSystemState方法的典型用法代码示例。如果您正苦于以下问题:Python Py.getSystemState方法的具体用法?Python Py.getSystemState怎么用?Python Py.getSystemState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.python.core.Py
的用法示例。
在下文中一共展示了Py.getSystemState方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __makeModule
# 需要导入模块: from org.python.core import Py [as 别名]
# 或者: from org.python.core.Py import getSystemState [as 别名]
def __makeModule(name, code, path):
module = _imp.addModule(name)
builtins = _Py.getSystemState().builtins
frame = _Frame(code, module.__dict__, module.__dict__, builtins)
module.__file__ = path
code.call(frame) # execute module code
return module
示例2: createMindMap
# 需要导入模块: from org.python.core import Py [as 别名]
# 或者: from org.python.core.Py import getSystemState [as 别名]
def createMindMap( self ):
import org.python.core.Py as Py
system_state = Py.getSystemState()
sscl = system_state.getClassLoader()
try:
try:
ccl = java.lang.Thread.currentThread().getContextClassLoader()
cpath = java.lang.System.getProperty( "java.class.path" )
import leoFreeMindView
#Each of these 3 calls play a pivotal role in loading the system
java.lang.System.setProperty( "java.class.path", "" )
java.lang.Thread.currentThread().setContextClassLoader( leoFreeMindView.mmcl )
system_state.setClassLoader( leoFreeMindView.mmcl )
self.mm = leoFreeMindView.mindmap( self.c )
self.mindmap = self.mm.mindmapview
ml = MListener( self.mm._free_leo_mind.updateMenus )
self.mm._free_leo_mind.getMainMenu().addMenuListener( ml )
except java.lang.Exception, x:
x.printStackTrace()
swing.JOptionPane.showMessageDialog( None, "Cant Load MindMap View." )
finally:
java.lang.System.setProperty( "java.class.path", cpath )
java.lang.Thread.currentThread().setContextClassLoader( ccl )
system_state.setClassLoader( sscl )
示例3: getSystemState
# 需要导入模块: from org.python.core import Py [as 别名]
# 或者: from org.python.core.Py import getSystemState [as 别名]
def getSystemState(self):
if not self.realInterp: return Py.getSystemState()
return self.realInterp.getSystemState()
示例4: getSystemState
# 需要导入模块: from org.python.core import Py [as 别名]
# 或者: from org.python.core.Py import getSystemState [as 别名]
def getSystemState(self):
from org.python.core import Py
if not self.realInterp: return Py.getSystemState()
return self.realInterp.getSystemState()
示例5: SpellDictionaryHashMap
# 需要导入模块: from org.python.core import Py [as 别名]
# 或者: from org.python.core.Py import getSystemState [as 别名]
clb2.importClass( "SpellDictionaryHashMap", "com.swabunga.spell.engine.SpellDictionaryHashMap" )
#clb2.importClass( "SpellDictionaryCachedDichoDisk", "com.swabunga.spell.engine.SpellDictionaryCachedDichoDisk" )
clb2.importClass( "StringWordTokenizer", "com.swabunga.spell.event.StringWordTokenizer" )
proppath = g.os_path_join( g.app.loadDir, "..", "plugins", "spellingdicts", "which.txt" ) #we start to determine which dictionary to use
fis = io.FileInputStream( io.File( proppath ) )
properties = util.Properties()
properties.load( fis )
fis.close()
fis = None
lfile = properties.getProperty( "dict" )
dpath = g.os_path_join( g.app.loadDir, "..", "plugins", "spellingdicts", lfile )
dictionary = SpellDictionaryHashMap( io.File( dpath ) )
import org.python.core.Py as Py #now we descend into the Jython internals...
sstate = Py.getSystemState()
cloader = sstate.getClassLoader()
sstate.setClassLoader( clb2 )#we do this so the JyLeoSpellChecker class can implement SpellCheckListener, otherwise it fails
except java.lang.Exception:
load_ok = False
if load_ok:
#@ <<JyLeoSpellChecker>>
#@+node:zorcanda!.20051111215311.1:<<JyLeoSpellChecker>>
class JyLeoSpellChecker( SpellCheckListener ):
def __init__( self, editor ):
self.c = editor.c
self.editor = editor.editor
self.foldprotection = editor.foldprotection