Example #1
0
 def can_handle(url):
     if not url.startswith('file://'):
         log.debug("able to handle %s? no, not starting with file://" % url)
         return False
     path = url2path(url)
     if not h5py.is_hdf5(path):
         log.debug("able to handle %s? no, not hdf5 file" % url)
         return False
     log.debug("able to handle %s? yes" % url)
     return True
Example #2
0
 def can_handle(url):
     if not url.startswith('file://'):
         log.debug("able to handle %s? no, not starting with file://" % url)
         return False
     path = url2path(url)
     if not h5py.is_hdf5(path):
         log.debug("able to handle %s? no, not hdf5 file" % url)
         return False
     log.debug("able to handle %s? yes" % url)
     return True
Example #3
0
    def can_handle(url):
        if not url.startswith('file://'):
            log.debug("able to handle %s? no, invalid url" % url)
            return False

        path = url2path(url)
        if not is_bag(path):
            log.debug("able to handle %s? no, not a BAG" % url)
            return False

        log.debug("able to handle %s? yes" % url)
        return True
Example #4
0
    def can_handle(url):
        if not url.startswith('file://'):
            log.debug("able to handle %s? no, not starting with file://" % url)
            return False
        if not url.endswith('.asc'):
            log.debug("able to handle %s? no, missing .asc extension" % url)
            return False

        first_line = open(url2path(url)).readline()
        if first_line.split()[0].upper() != "NCOLS":
            log.debug("able to handle %s? no, invalid first line" % url)
            return False

        log.debug("able to handle %s? yes" % url)
        return True
Example #5
0
    def can_handle(url):
        if not url.startswith('file://'):
            log.debug("able to handle %s? no, not starting with file://" % url)
            return False
        if not url.endswith('.asc'):
            log.debug("able to handle %s? no, missing .asc extension" % url)
            return False

        first_line = open(url2path(url)).readline()
        if first_line.split()[0].upper() != "NCOLS":
            log.debug("able to handle %s? no, invalid first line" % url)
            return False

        log.debug("able to handle %s? yes" % url)
        return True
Example #6
0
 def __init__(self, url):
     if not self.can_handle(url):
         raise ValueError(url)
     self._url = url
     path = url2path(url)
     self.f = h5py.File(path, 'r')
Example #7
0
 def getFilePath(self):
     return url2path(self._url)
Example #8
0
 def __init__(self, url):
     if not self.can_handle(url):
         raise ValueError(url)
     self._url = url
     path = url2path(url)
     self.f = BAGFile(path, 'r')
Example #9
0
 def getFilePath(self):
     return url2path(self._url)