Exemplo n.º 1
0
    def upload_files(self):
        # hacky
        for f in self.files:
            if f:
                basedir = os.path.dirname(f)
                candidates = os.listdir(basedir)

                if fileutils.is_program(f):
                    filterProgram = f
                    filtered = []
                    program = fileparser.ProgramParser().parse(filterProgram)
                    for kg in program.keygroups:
                        for zone in kg.zones:
                            if zone.samplename:
                                filtered.append(
                                    find_file(basedir, candidates,
                                              zone.samplename))
                    self.files.extend(filtered)

        already_done = []
        for f in self.files:
            if f and not f in already_done:
                self.s.transfertools.put(f)
                already_done.append(f)

        self.do_lists()
Exemplo n.º 2
0
 def get(self, filename, destpath=None, source=AkaiSampler.MEMORY):
     log.debug("Transferring file %s to host from source %i" % (filename, source))
     try:
         if fileutils.is_sample(filename):
             shutil.copy(self.sample_file, destpath)
         elif fileutils.is_program(filename):
             shutil.copy(self.program_file, destpath)
     except IOError:
         raise model.SamplerException("Failed to get ", filename)
Exemplo n.º 3
0
def get_file_type(name):
    assert name is not None
    
    if fileutils.is_multi(name):
        return Multi, FileRef.MULTI
    if fileutils.is_program(name):
        return Program, FileRef.PROGRAM
    if fileutils.is_sample(name):
        return Sample, FileRef.SAMPLE
    if fileutils.is_song(name):
        return Song, FileRef.SONG
    
    msg = "No support for file type: %s", name
    LOG.exception(msg)
    raise NotImplementedError(msg)
Exemplo n.º 4
0
def get_file_type(name):
    assert name is not None

    if fileutils.is_multi(name):
        return Multi, FileRef.MULTI
    if fileutils.is_program(name):
        return Program, FileRef.PROGRAM
    if fileutils.is_sample(name):
        return Sample, FileRef.SAMPLE
    if fileutils.is_song(name):
        return Song, FileRef.SONG

    msg = "No support for file type: %s", name
    LOG.exception(msg)
    raise NotImplementedError(msg)
Exemplo n.º 5
0
 def upload_files(self):
     # hacky
     for f in self.files:
         if f:
             basedir = os.path.dirname(f)
             candidates = os.listdir(basedir)
             
             if fileutils.is_program(f):
                 filterProgram = f
                 filtered = []
                 program = fileparser.ProgramParser().parse(filterProgram)
                 for kg in program.keygroups:
                     for zone in kg.zones:
                         if zone.samplename:
                             filtered.append(find_file(basedir, candidates, zone.samplename))
                 self.files.extend(filtered)
                 
     already_done = []
     for f in self.files:
         if f and not f in already_done:
             self.s.transfertools.put(f)
             already_done.append(f)
             
     self.do_lists()