예제 #1
0
    def initialize(self, path, fwparams, headers, fileparams):

        self.path, self.fileparams = textfile.initialize_file(path, fileparams)
        if not fwparams.get('fieldwidths'):
            raise AttributeError
        self.fwparams = fwparams
        self.headers = headers
예제 #2
0
    def initialize(self, path, fwparams, headers, fileparams):

        self.path, self.fileparams = textfile.initialize_file(path, fileparams)
        if not fwparams.get('fieldwidths'):
            raise AttributeError
        self.fwparams = fwparams
        self.headers = headers
예제 #3
0
    def initialize(self, path, csvparams, headers, fileparams):

        self.path, self.fileparams = textfile.initialize_file(path, fileparams)
        self.csvparams = {} if not csvparams else csvparams
        self.headers = headers
예제 #4
0
def test_initialize_file(csv_with_headers):
    path = csv_with_headers
    assert textfile.initialize_file(path) == (path, {})
    with pytest.raises(IOError):
        textfile.initialize_file('does_not_exist')
예제 #5
0
    def initialize(self, path, csvparams, headers, fileparams):

        self.path, self.fileparams = textfile.initialize_file(path, fileparams)
        self.csvparams = {} if not csvparams else csvparams
        self.headers = headers