本文整理汇总了Python中pisi.file.File.make_uri方法的典型用法代码示例。如果您正苦于以下问题:Python File.make_uri方法的具体用法?Python File.make_uri怎么用?Python File.make_uri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pisi.file.File
的用法示例。
在下文中一共展示了File.make_uri方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: readxml
# 需要导入模块: from pisi.file import File [as 别名]
# 或者: from pisi.file.File import make_uri [as 别名]
def readxml(self, uri, tmpDir = '/tmp'):
uri = File.make_uri(uri)
localpath = File.download(uri, tmpDir)
try:
self.doc = ParsePath(localpath)
return self.doc.documentElement
except Ft.FtException, e:
raise Error(_("File '%s' has invalid XML: %s") % (localpath, str(e)) )
示例2: readxml
# 需要导入模块: from pisi.file import File [as 别名]
# 或者: from pisi.file.File import make_uri [as 别名]
def readxml(self, uri, tmpDir="/tmp"):
uri = File.make_uri(uri)
localpath = File.download(uri, tmpDir)
try:
self.doc = mdom.parse(localpath)
except ExpatError, inst:
raise Error(_("File '%s' has invalid XML: %s\n") % (fileName, str(inst)))
示例3: readxml
# 需要导入模块: from pisi.file import File [as 别名]
# 或者: from pisi.file.File import make_uri [as 别名]
def readxml(self, uri, tmpDir='/tmp', sha1sum=False, compress=None, sign=None):
uri = File.make_uri(uri)
localpath = File.download(uri, tmpDir,sha1sum=sha1sum,compress=compress,sign=sign)
try:
self.doc = NoExtDtdReader.parseUri(Ft.Lib.Uri.OsPathToUri(localpath))
return self.doc.documentElement
except Ft.FtException, e:
raise Error(_("File '%s' has invalid XML: %s") % (localpath, str(e)) )
示例4: readxml
# 需要导入模块: from pisi.file import File [as 别名]
# 或者: from pisi.file.File import make_uri [as 别名]
def readxml(self, uri, tmpDir='/tmp', sha1sum=False, compress=None, sign=None):
uri = File.make_uri(uri)
localpath = File.download(uri, tmpDir,sha1sum=sha1sum,compress=compress,sign=sign)
try:
self.doc = iks.parse(localpath)
return self.doc
except Exception, e:
raise Error(_("File '%s' has invalid XML") % (localpath) )
示例5: download
# 需要导入模块: from pisi.file import File [as 别名]
# 或者: from pisi.file.File import make_uri [as 别名]
def download(self, uri, transferdir):
# fix auth info and download
uri = File.make_uri(uri)
File.download(uri, transferdir)
示例6: download
# 需要导入模块: from pisi.file import File [as 别名]
# 或者: from pisi.file.File import make_uri [as 别名]
def download(self, uri, transferdir):
# fix auth info and download
uri = File.make_uri(uri)
if self.authinfo:
uri.set_auth_info(self.authinfo)
File.download(uri, transferdir)
示例7: testMakeUri
# 需要导入模块: from pisi.file import File [as 别名]
# 或者: from pisi.file.File import make_uri [as 别名]
def testMakeUri(self):
spec = SpecFile("repos/pardus-2007/system/base/curl/pspec.xml")
url = uri.URI(spec.source.archive[0].uri)
self.assert_(File.make_uri(url))
示例8: testMakeUri
# 需要导入模块: from pisi.file import File [as 别名]
# 或者: from pisi.file.File import make_uri [as 别名]
def testMakeUri(self):
self.spec = SpecFile()
self.url = uri.URI(self.spec.source.archive.uri)
f = File('repos/pardus-2007/system/base/curl/pspec.xml', File.read)
self.assert_(f.make_uri('uri'))