def __init__(self, file): self.file = file with open(file, 'rb') as csvfile: self.csvData = list(csv.reader(csvfile)) with open(file, 'wb') as csvfile: writer = csv.writer(csvfile) writer.writerows(self.csvData) print('which is the resume?') self.resumeCol = ui.getChoice(self.csvData[0], range(len(self.csvData[0]))) print('where do labels go?') labelCol = ui.getChoice(self.csvData[0] + ['[ new ]'], range(len(self.csvData[0]) + 1)) self.labelCol = labelCol print('is there a header row?') hasHeader = ui.getChoice(['yes', 'no'], [True, False]) if(hasHeader): if(not self.csvData[0][labelCol]): self.csvData[0][labelCol] = 'label' resumes = [ ResumeFromCsv( row, self.resumeCol, labelCol, self.save ) for row in self.csvData[hasHeader:] if(labelCol >= len(row) or not row[labelCol]) ] super(CsvResumeScrubber, self).__init__(resumes)
def __init__(self, file): self.file = file with open(file, "rb") as csvfile: self.csvData = list(csv.reader(csvfile)) with open(file, "wb") as csvfile: writer = csv.writer(csvfile) writer.writerows(self.csvData) print("which is the resume?") self.resumeCol = ui.getChoice(self.csvData[0], range(len(self.csvData[0]))) print("where do labels go?") labelCol = ui.getChoice(self.csvData[0] + ["[ new ]"], range(len(self.csvData[0]) + 1)) self.labelCol = labelCol print("is there a header row?") hasHeader = ui.getChoice(["yes", "no"], [True, False]) if hasHeader: if not self.csvData[0][labelCol]: self.csvData[0][labelCol] = "label" resumes = [ ResumeFromCsv(row, self.resumeCol, labelCol, self.save) for row in self.csvData[hasHeader:] if (labelCol >= len(row) or not row[labelCol]) ] super(CsvResumeScrubber, self).__init__(resumes)
#!/usr/bin/env python from dirScrubber import DirResumeScrubber from csvScrubber import CsvResumeScrubber import uicomponents as ui import sys labels = [ 'one Fulltime', 'two Fulltime', 'three Fulltime', 'one Intern', 'two Intern', 'three Intern', 'flag', 'waitlist' ] print('What is the resume list format?') format = ui.getChoice(['csv', 'file glob']) print('\n') scrubber = None if (format == 'csv'): file = sys.argv[1] if (not file): file = raw_input('enter file name:\n') scrubber = CsvResumeScrubber(file) elif (format == 'file glob'): glob = sys.argv[1] if (not glob): glob = raw_input('enter glob:\n') scrubber = DirResumeScrubber(glob) for resume in scrubber: resume.open() choice = ui.getChoice(labels)
import uicomponents as ui import sys labels = [ 'one Fulltime', 'two Fulltime', 'three Fulltime', 'one Intern', 'two Intern', 'three Intern', 'flag', 'waitlist' ] print('What is the resume list format?') format = ui.getChoice(['csv', 'file glob']) print('\n') scrubber = None if(format == 'csv'): file = sys.argv[1] if(not file): file = raw_input('enter file name:\n') scrubber = CsvResumeScrubber(file) elif(format == 'file glob'): glob = sys.argv[1] if(not glob): glob = raw_input('enter glob:\n') scrubber = DirResumeScrubber(glob) for resume in scrubber: