def __init__(self, fname, workdir=None, update=False, nobuild=False, index=None):
        """
        Create the PositionalData
        """
        self.fname = fname
        self.db = None

        # split the incoming name to find the real name, and base directory
        basedir, basename = os.path.split(self.fname)

        # the index may be stored in the workdir if it was specified
        basedir = workdir or basedir

        # this is the HDF index name that the file operates on
        self.index = index or conf.path_join(basedir, "%s.hdf" % basename)

        # debug messages
        logger.debug("file path %s" % self.fname)
        logger.debug("index path %s" % self.index)

        # no building permitted
        if nobuild and missing(self.index):
            raise Exception("No autobuild allowed and no index found at %s" % self.index)

        # creating indices if these are missing or an update is forced
        if update or missing(self.index):
            self.build()

        # operates on the HDF file
        self.db = openFile(self.index, mode="r")
        self.root = self.db.root

        # shows the internal labels
        logger.debug("index labels -> %s" % self.labels)
def galaxy(request):
    """
    Returns a data view based on a galaxy forward
    """

    # validates a filename
    filename, encoded, hashkey, dataid, galaxy_url = validate_filename(request)
   
    # access the data on the filesystem
    # extract the work directory from the filename
    path, fname = os.path.split(filename)
    name, ext = os.path.splitext(fname)
    workdir = conf.path_join(path, name+"_files")
    print workdir
    
    index = hdflib.PositionalData(fname='', index=filename, nobuild=True, workdir=workdir)
    #url = urlib.urlencode()
    url = "/galaxy/?filename=%s&hashkey=%s&input=%s&GALAXY_URL=%s" % (encoded, hashkey, dataid, galaxy_url)
    return browser(request=request, index=index, url=url, dataid=dataid, galaxy_url=galaxy_url)
    def __init__(self,
                 fname,
                 workdir=None,
                 update=False,
                 nobuild=False,
                 index=None):
        """
        Create the PositionalData
        """
        self.fname = fname
        self.db = None

        # split the incoming name to find the real name, and base directory
        basedir, basename = os.path.split(self.fname)

        # the index may be stored in the workdir if it was specified
        basedir = workdir or basedir

        # this is the HDF index name that the file operates on
        self.index = index or conf.path_join(basedir, '%s.hdf' % basename)

        # debug messages
        logger.debug('file path %s' % self.fname)
        logger.debug('index path %s' % self.index)

        # no building permitted
        if nobuild and missing(self.index):
            raise Exception('No autobuild allowed and no index found at %s' %
                            self.index)

        # creating indices if these are missing or an update is forced
        if update or missing(self.index):
            self.build()

        # operates on the HDF file
        self.db = openFile(self.index, mode='r')
        self.root = self.db.root

        # shows the internal labels
        logger.debug('index labels -> %s' % self.labels)
Exemple #4
0
    # exclusion mode
    if options.exclude:
        targets = [name for name in all_tests() if name not in targets]

    if options.verbosity == 0:
        logger.disable('INFO')
    elif options.verbosity == 1:
        logger.disable('DEBUG')
    elif options.verbosity >= 2:
        logger.disable(None)

    # cleans full entire test directory
    if options.reset:
        conf.reset_dir(conf.TEMP_DATA_DIR)

    # run all the tests
    if options.coverage:
        coverdir = conf.path_join(conf.TEST_DIR, 'coverage')
        good, bad, skip = testutil.generate_coverage(run,
                                                     coverdir,
                                                     targets=targets,
                                                     options=options)
    else:
        good, bad, skip = run(targets=targets, options=options)

    if bad:
        sys.exit(-1)

    sys.exit(0)
    targets = [ t.rstrip(".py") for t in targets ]

    # exclusion mode
    if options.exclude:
        targets = [ name for name in all_tests() if name not in targets ]

    if options.verbosity == 0:
        logger.disable('INFO')
    elif options.verbosity == 1:
        logger.disable('DEBUG')
    elif options.verbosity >= 2:
        logger.disable(None)

    # cleans full entire test directory
    if options.reset:
        conf.reset_dir(conf.TEMP_DATA_DIR)
    
    # run all the tests
    if options.coverage:
        coverdir = conf.path_join(conf.TEST_DIR, 'coverage')
        good, bad, skip = testutil.generate_coverage(run, coverdir,
                                                     targets=targets,
                                                     options=options)
    else:
        good, bad, skip = run(targets=targets, options=options)

    if bad:
        sys.exit(-1)

    sys.exit(0)
 def thumbpath(self):
     "Thumbnail image path"
     return conf.path_join(settings.THUMB_IMAGE_DIR, self.thumbname)