mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-10 16:26: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:
|
else:
|
||||||
# Reading Configuration Template section
|
# Reading Configuration Template section
|
||||||
# we want the attribute to exists for further usage
|
# 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
|
# we parse some columns definitions
|
||||||
|
@ -60,8 +60,10 @@ class DataReader:
|
|||||||
else:
|
else:
|
||||||
self.db.empty_string = EMPTY_STRING
|
self.db.empty_string = EMPTY_STRING
|
||||||
|
|
||||||
# optionnal field separator
|
# optionnal field separator, could be defined from template
|
||||||
self.field_sep = FIELD_SEP
|
if 'field_sep' not in self.__dict__:
|
||||||
|
self.field_sep = FIELD_SEP
|
||||||
|
|
||||||
if config.has_option(name, 'field_sep'):
|
if config.has_option(name, 'field_sep'):
|
||||||
self.field_sep = config.get(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 null: '%s'" % self.db.null
|
||||||
print "reader.readconfig empty_string: '%s'" \
|
print "reader.readconfig empty_string: '%s'" \
|
||||||
% self.db.empty_string
|
% self.db.empty_string
|
||||||
|
print "reader.readconfig field_sep: '%s'" % self.field_sep
|
||||||
|
|
||||||
def readlines(self):
|
def readlines(self):
|
||||||
""" read data from configured file, and generate (yields) for
|
""" read data from configured file, and generate (yields) for
|
||||||
|
Loading…
Reference in New Issue
Block a user