Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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')
Esempio n. 7
0
 def getFilePath(self):
     return url2path(self._url)
Esempio n. 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')
Esempio n. 9
0
 def getFilePath(self):
     return url2path(self._url)