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)) )
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) )
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)))
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", 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))
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)))
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))
def download(self, uri, transferdir): # fix auth info and download uri = File.make_uri(uri) File.download(uri, transferdir)
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)