'Extract the details for a CSV Import Task'

def extract_csv_import_line(self, path, details):

    argCnt = len(details)
    if ((argCnt == 4) or (argCnt == 5)):
        mod = details[0].strip('"    ')
        res = details[1].strip('"    ')
        folder = current.request.folder
        csvFileName = details[2].strip('"    ')
        if (csvFileName[:7] == 'http://'):
            csv = csvFileName
        else:
            (csvPath, csvFile) = os.path.split(csvFileName)
            if (csvPath != ''):
                path = os.path.join(folder, 'modules', 'templates', csvPath)
                if (not os.path.exists(path)):
                    path = os.path.join(folder, 'private', 'templates', csvPath)
            csv = os.path.join(path, csvFile)
        xslFileName = details[3].strip('"    ')
        templateDir = os.path.join(folder, 'static', 'formats', 's3csv')
        xsl = os.path.join(templateDir, mod, xslFileName)
        if (os.path.exists(xsl) == False):
            xsl = os.path.join(templateDir, xslFileName)
            if (os.path.exists(xsl) == False):
                xsl = os.path.join(path, xslFileName)
                if (os.path.exists(xsl) == False):
                    self.errorList.append(('Failed    to    find    a    transform    file    %s,    Giving    up.' % xslFileName))
                    return
        if (argCnt == 5):
            extra_data = details[4]
        else:
            extra_data = None
        self.tasks.append([1, mod, res, csv, xsl, extra_data])
    else:
        self.errorList.append(('prepopulate    error:    job    not    of    length    4,    ignored:    %' % details))
