mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-09 15:56:58 +02:00
FIX: reader option field_sep could have been set by template, pgloader.table too
This commit is contained in:
parent
141d8ec19a
commit
b85cc13d08
@ -182,7 +182,8 @@ class PGLoader:
|
||||
else:
|
||||
# Reading Configuration Template section
|
||||
# we want the attribute to exists for further usage
|
||||
self.__dict__[opt] = None
|
||||
if opt not in self.__dict__:
|
||||
self.__dict__[opt] = None
|
||||
|
||||
##
|
||||
# we parse some columns definitions
|
||||
|
@ -60,8 +60,10 @@ class DataReader:
|
||||
else:
|
||||
self.db.empty_string = EMPTY_STRING
|
||||
|
||||
# optionnal field separator
|
||||
self.field_sep = FIELD_SEP
|
||||
# optionnal field separator, could be defined from template
|
||||
if 'field_sep' not in self.__dict__:
|
||||
self.field_sep = FIELD_SEP
|
||||
|
||||
if config.has_option(name, 'field_sep'):
|
||||
self.field_sep = config.get(name, 'field_sep')
|
||||
|
||||
@ -73,6 +75,7 @@ class DataReader:
|
||||
print "reader.readconfig null: '%s'" % self.db.null
|
||||
print "reader.readconfig empty_string: '%s'" \
|
||||
% self.db.empty_string
|
||||
print "reader.readconfig field_sep: '%s'" % self.field_sep
|
||||
|
||||
def readlines(self):
|
||||
""" read data from configured file, and generate (yields) for
|
||||
|
Loading…
Reference in New Issue
Block a user