Exemplo n.º 1
0
    def is_inputfile(self, filekey):
        print 'is_inputfile', filekey

        filepaths = self.files_input.filepath.get(filekey)
        # print '  filepaths =',filepaths,type(filepaths)
        if type(filepaths) in types.StringTypes:
            # print '    call filepathstring_to_filepathlist'
            filepaths = filepathstring_to_filepathlist(filepaths)

        # print  '  filepaths list',filepaths
        if len(filepaths) > 0:
            ans = True
            for filepath in filepaths:
                dirpath = os.path.dirname(filepath)
                # this is to make sure that check always works
                # either with filename or with filepath
                if (self._workdirpath != None) & (dirpath == ''):
                    filepath = os.path.join(self._workdirpath, filepath)
                print '  check is_inputfile: >>%s<< exists = %d' % (
                    filepath, os.path.isfile(filepath))
                ans = ans & os.path.isfile(filepath)
            # print '  is_inputfile=',ans
            return ans
        else:
            return False  # no path given
Exemplo n.º 2
0
    def is_outputfile(self, filekey):
        ans = True
        filepaths = self.files_output.filepath.get(filekey)
        # print '\nis_outputfile  filepaths = >%s<'%filepaths,type(filepaths)
        if type(filepaths) in types.StringTypes:
            # print '    call filepathstring_to_filepathlist'
            filepaths = filepathstring_to_filepathlist(filepaths)

        # print  '  filepaths list',filepaths
        for filepath in filepaths:
            dirpath = os.path.dirname(filepath)
            # this is to make sure that check always works
            # either with filename or with filepath
            if (self._workdirpath is not None) & (dirpath == ''):
                filepath = os.path.join(self._workdirpath, filepath)
            # print '  check is_outputfile: >>%s<< exists = %d'%(filepath,os.path.isfile(filepath))
            ans = ans & os.path.isfile(filepath)
        # print '  is_outputfile=',ans
        return ans
    def is_outputfile(self, filekey):
        ans = True
        filepaths = self.files_output.filepath.get(filekey)
        # print '\nis_outputfile  filepaths = >%s<'%filepaths,type(filepaths)
        if type(filepaths) in types.StringTypes:
            # print '    call filepathstring_to_filepathlist'
            filepaths = filepathstring_to_filepathlist(filepaths)

        # print  '  filepaths list',filepaths
        for filepath in filepaths:
            dirpath = os.path.dirname(filepath)
            # this is to make sure that check always works
            # either with filename or with filepath
            if (self._workdirpath is not None) & (dirpath == ''):
                filepath = os.path.join(self._workdirpath, filepath)
            # print '  check is_outputfile: >>%s<< exists = %d'%(filepath,os.path.isfile(filepath))
            ans = ans & os.path.isfile(filepath)
        # print '  is_outputfile=',ans
        return ans
Exemplo n.º 4
0
    def is_inputfile(self, filekey):
        print 'is_inputfile', filekey

        filepaths = self.files_input.filepath.get(filekey)
        # print '  filepaths =',filepaths,type(filepaths)
        if type(filepaths) in types.StringTypes:
            # print '    call filepathstring_to_filepathlist'
            filepaths = filepathstring_to_filepathlist(filepaths)

        # print  '  filepaths list',filepaths
        if len(filepaths) > 0:
            ans = True
            for filepath in filepaths:
                dirpath = os.path.dirname(filepath)
                # this is to make sure that check always works
                # either with filename or with filepath
                if (self._workdirpath != None) & (dirpath == ''):
                    filepath = os.path.join(self._workdirpath, filepath)
                print '  check is_inputfile: >>%s<< exists = %d' % (filepath, os.path.isfile(filepath))
                ans = ans & os.path.isfile(filepath)
            # print '  is_inputfile=',ans
            return ans
        else:
            return False  # no path given