示例#1
0
 def __init__(
     self,
     filename,
     name,
     encoding="utf-8",
     single_sheet_in_book=False,
     sheet_index=None,
     **keywords
 ):
     self._encoding = encoding
     self._sheet_name = name
     self._single_sheet_in_book = single_sheet_in_book
     self.__line_terminator = constants.DEFAULT_CSV_NEWLINE
     if constants.KEYWORD_LINE_TERMINATOR in keywords:
         self.__line_terminator = keywords.get(
             constants.KEYWORD_LINE_TERMINATOR
         )
     if single_sheet_in_book:
         self._sheet_name = None
     self._sheet_index = sheet_index
     self.writer = None
     self.file_handle = None
     SheetWriter.__init__(
         self, filename, self._sheet_name, self._sheet_name, **keywords
     )
示例#2
0
文件: django.py 项目: St4nK/aurorai
 def __init__(self, importer, adapter, batch_size=None):
     SheetWriter.__init__(self, importer, adapter, adapter.name)
     self.__batch_size = batch_size
     self.__model = adapter.model
     self.__column_names = adapter.column_names
     self.__mapdict = adapter.column_name_mapping_dict
     self.__initializer = adapter.row_initializer
     self.__objs = []
示例#3
0
 def __init__(self, importer, adapter, batch_size=None, bulk_save=True):
     SheetWriter.__init__(self, importer, adapter, adapter.name)
     self.__batch_size = batch_size
     self.__model = adapter.model
     self.__column_names = adapter.column_names
     self.__mapdict = adapter.column_name_mapping_dict
     self.__initializer = adapter.row_initializer
     self.__objs = []
     self.__bulk_save = bulk_save
示例#4
0
 def __init__(
     self, importer, adapter, auto_commit=True, bulk_size=1000, **keywords
 ):
     SheetWriter.__init__(
         self, importer, adapter, adapter.get_name(), **keywords
     )
     self.__auto_commit = auto_commit
     self.__count = 0
     self.__bulk_size = bulk_size
示例#5
0
 def __init__(self,
              importer,
              adapter,
              auto_commit=True,
              bulk_size=1000,
              **keywords):
     SheetWriter.__init__(self, importer, adapter, adapter.get_name(),
                          **keywords)
     self.__auto_commit = auto_commit
     self.__count = 0
     self.__bulk_size = bulk_size
示例#6
0
 def __init__(self,
              filename,
              name,
              encoding="utf-8",
              single_sheet_in_book=False,
              sheet_index=None,
              **keywords):
     self._encoding = encoding
     self._sheet_name = name
     self._single_sheet_in_book = single_sheet_in_book
     self.__line_terminator = DEFAULT_NEWLINE
     if constants.KEYWORD_LINE_TERMINATOR in keywords:
         self.__line_terminator = keywords.get(
             constants.KEYWORD_LINE_TERMINATOR)
     if single_sheet_in_book:
         self._sheet_name = None
     self._sheet_index = sheet_index
     SheetWriter.__init__(self, filename, self._sheet_name,
                          self._sheet_name, **keywords)
示例#7
0
 def __init__(self, importer, adapter, auto_commit=True, **keywords):
     SheetWriter.__init__(self, importer, adapter,
                          adapter.get_name(), **keywords)
     self.__auto_commit = auto_commit
示例#8
0
 def __init__(self, importer, adapter, auto_commit=True, **keywords):
     SheetWriter.__init__(self, importer, adapter, adapter.get_name(),
                          **keywords)
     self.__auto_commit = auto_commit