当前位置: 首页>>代码示例>>Python>>正文


Python Py.getSystemState方法代码示例

本文整理汇总了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
开发者ID:343829084,项目名称:OpenRefine,代码行数:9,代码来源:pycimport.py

示例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 )
开发者ID:leo-editor,项目名称:leo-editor-contrib,代码行数:31,代码来源:MindMapPlugin.py

示例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()
开发者ID:seojiwon,项目名称:socialite,代码行数:5,代码来源:console.py

示例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()
开发者ID:David-Bess,项目名称:medicare-demo,代码行数:6,代码来源:console.py

示例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
开发者ID:leo-editor,项目名称:leo-editor-contrib,代码行数:33,代码来源:JyLeoSpellChecker.py


注:本文中的org.python.core.Py.getSystemState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。