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)) )
Exemple #2
0
    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)))
 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)) )
 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) )
Exemple #5
0
 def readxml(self, uri, tmpDir="/tmp"):
     uri = File.make_uri(uri)
     localpath = File.download(uri, tmpDir)
     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)))
Exemple #6
0
    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)))
Exemple #7
0
 def readxml(self, uri, tmpDir="/tmp", sha1sum=False, compress=None, sign=None, copylocal=False):
     uri = File.make_uri(uri)
     # try:
     localpath = File.download(uri, tmpDir, sha1sum=sha1sum, compress=compress, sign=sign, copylocal=copylocal)
     # except IOError, e:
     #    raise Error(_("Cannot read URI %s: %s") % (uri, unicode(e)) )
     try:
         self.doc = iks.parse(localpath)
         return self.doc
     except Exception, e:
         raise Error(_("File '%s' has invalid XML") % (localpath))
Exemple #8
0
 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)))
Exemple #9
0
 def readxml(self,
             uri,
             tmpDir='/tmp',
             sha1sum=False,
             compress=None,
             sign=None,
             copylocal=False):
     uri = File.make_uri(uri)
     #try:
     localpath = File.download(uri,
                               tmpDir,
                               sha1sum=sha1sum,
                               compress=compress,
                               sign=sign,
                               copylocal=copylocal)
     #except IOError, e:
     #    raise Error(_("Cannot read URI %s: %s") % (uri, unicode(e)) )
     try:
         self.doc = iks.parse(localpath)
         return self.doc
     except Exception, e:
         raise Error(_("File '%s' has invalid XML") % (localpath))
Exemple #10
0
 def download(self, uri, transferdir):
     # fix auth info and download
     uri = File.make_uri(uri)
     File.download(uri, transferdir)
Exemple #11
0
 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))
Exemple #12
0
 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)
Exemple #13
0
 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))
Exemple #14
0
 def download(self, uri, transferdir):
     # fix auth info and download
     uri = File.make_uri(uri)
     File.download(uri, transferdir)
Exemple #15
0
 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'))