Exemplo n.º 1
0
    def __init__(self,
                 column_names,
                 query_sets,
                 sheet_name=None,
                 row_renderer=None,
                 start_row=0,
                 row_limit=-1,
                 start_column=None,
                 column_limit=None,
                 skip_row_func=None,
                 skip_column_func=None,
                 **keywords):
        self.__sheet_name = sheet_name
        if self.__sheet_name is None:
            self.__sheet_name = constants.DEFAULT_SHEET_NAME
        self.__column_names = column_names
        self.__query_sets = query_sets
        self.__row_renderer = row_renderer
        self.__start_row = start_row
        self.__row_limit = row_limit
        self.__skip_row_func = skip_row_func

        if start_column is None:
            print("start_column is ignored")
        if column_limit is None:
            print("column_limit is ignored")
        if skip_column_func is None:
            print("skip_column_func is ignored")
        Source.__init__(self, **keywords)
Exemplo n.º 2
0
 def __init__(self,
              db_type,
              export_columns=None,
              sheet_name=None,
              **keywords):
     self._db_type = db_type
     self.__export_columns = export_columns
     self.__sheet_name = sheet_name
     Source.__init__(self, **keywords)
Exemplo n.º 3
0
 def __init__(self,
              adict,
              with_keys=True,
              sheet_name=DEFAULT_SHEET_NAME,
              **keywords):
     self.__adict = adict
     self.__with_keys = with_keys
     self._content = _FakeIO()
     self.__sheet_name = sheet_name
     Source.__init__(self, **keywords)
Exemplo n.º 4
0
 def __init__(self, records, sheet_name=DEFAULT_SHEET_NAME, **keywords):
     self.__records = records
     self._content = _FakeIO()
     self.__sheet_name = sheet_name
     Source.__init__(self, **keywords)
Exemplo n.º 5
0
 def __init__(self, bookdict, **keywords):
     self.__bookdict = bookdict
     self._content = _FakeIO()
     Source.__init__(self, **keywords)
Exemplo n.º 6
0
 def __init__(self, array, sheet_name=DEFAULT_SHEET_NAME, **keywords):
     self.__array = array
     self._content = _FakeIO()
     self.__sheet_name = sheet_name
     Source.__init__(self, **keywords)
Exemplo n.º 7
0
def test_write_only_source():
    source = Source()
    source.get_data()
Exemplo n.º 8
0
def test_read_only_source():
    source = Source()
    source.write_data("something")
Exemplo n.º 9
0
def test_source_class_method():
    assert Source.is_my_business('read', source="asource") is True
    assert Source.is_my_business('read', file_name="asource") is False
Exemplo n.º 10
0
def test_source():
    source = Source(source="asource", params="params")
    info = source.get_source_info()
    assert info, (None, None)
Exemplo n.º 11
0
 def __init__(self, db_type, **keywords):
     self.__db_type = db_type
     Source.__init__(self, **keywords)
Exemplo n.º 12
0
 def __init__(self, url=None, **keywords):
     self.__url = url
     Source.__init__(self, **keywords)