#!/usr/bin/env python
# -*- coding: utf-8 -*-

import csv

class CsvConverter:

    def __init__(self, csv_file_path):
        self.csv_file_path = csv_file_path
        self.rows = []
        self.source_product_code = "product_code"
        self.source_quantity = "quantity"

    def clear(self):
        self.rows = []

    def addRow(self, row):
        self.rows.append(row)

    def getRow(self, index):
        return self.rows[index]

    def setSourceColumns(self, source_product_code, source_quantity):
        self.source_product_code = source_product_code
        self.source_quantity = source_quantity

    def convertRow(self, row):
        if not row[self.source_product_code]:
            raise ValueError
        return {
            'product_code': row[self.source_product_code],
            'quantity': int(row[self.source_quantity])
        }

    def read_file(self):
        with open(self.csv_file_path, 'rb') as csvfile:
            reader = csv.DictReader(csvfile)
            for row in reader:
                self.addRow(self.convertRow(row))

@@ -874,80 +874,32 @@
 ead_
-file
+csv
 (self
-):%0A        with open(self.csv_file_path, 'rb') as csvfile:%0A    
+, file_object):%0A
     
@@ -930,15 +930,19 @@
 der(
-csv
 file
+_object
 )%0A  
@@ -947,20 +947,16 @@
         
-    
 for row 
@@ -966,20 +966,16 @@
 reader:%0A
-    
         
@@ -1012,8 +1012,125 @@
 w(row))%0A
+%0A    def read_file(self):%0A        with open(self.csv_file_path, 'rb') as csvfile:%0A            self.read_csv(csvfile)%0A

Split reading method