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


Python ClassLoader.getSystemResourceAsStream方法代码示例

本文整理汇总了Python中java.lang.ClassLoader.getSystemResourceAsStream方法的典型用法代码示例。如果您正苦于以下问题:Python ClassLoader.getSystemResourceAsStream方法的具体用法?Python ClassLoader.getSystemResourceAsStream怎么用?Python ClassLoader.getSystemResourceAsStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.lang.ClassLoader的用法示例。


在下文中一共展示了ClassLoader.getSystemResourceAsStream方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: archive_read

# 需要导入模块: from java.lang import ClassLoader [as 别名]
# 或者: from java.lang.ClassLoader import getSystemResourceAsStream [as 别名]
def archive_read(archive, path):
    from java.lang import ClassLoader
    from java.io import InputStreamReader, BufferedReader

    # --- make sure this works from within .jar files and such
    stream = ClassLoader.getSystemResourceAsStream(path)
    reader = BufferedReader(InputStreamReader(stream))
    archive.addAll(reader)
开发者ID:BackupTheBerlios,项目名称:gavrog,代码行数:10,代码来源:identify.py

示例2: resolveEntity

# 需要导入模块: from java.lang import ClassLoader [as 别名]
# 或者: from java.lang.ClassLoader import getSystemResourceAsStream [as 别名]
 def resolveEntity(self, publicId, systemId):
   return InputSource(ClassLoader.getSystemResourceAsStream("dtds/" + os.path.split(systemId)[1]))
开发者ID:jarl-haggerty,项目名称:profelis,代码行数:4,代码来源:utils.py

示例3: file

# 需要导入模块: from java.lang import ClassLoader [as 别名]
# 或者: from java.lang.ClassLoader import getSystemResourceAsStream [as 别名]
from java.lang import ClassLoader
from java.io import InputStreamReader, BufferedReader

# --- Gavrog stuff
from org.gavrog.joss.geometry import SpaceGroupFinder, CrystalSystem
from org.gavrog.joss.pgraphs.io import Net
from org.gavrog.joss.pgraphs.io import Archive


# ============================================================
#   Prepare for RCSR lookup
# ============================================================

# --- get RCSR archive file (possibly from a .jar or the web)
rcsr_path = "org/gavrog/apps/systre/rcsr.arc"
rcsr_stream = ClassLoader.getSystemResourceAsStream(rcsr_path)
reader = BufferedReader(InputStreamReader(rcsr_stream))

# --- create an archive object from it
archive = Archive("1.0")
archive.addAll(reader)


# ============================================================
#   Main data processing
# ============================================================

# --- dictionary of seen nets
seen = {}

# --- count the nets that we read
开发者ID:BackupTheBerlios,项目名称:gavrog,代码行数:33,代码来源:unique_nets.py


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