Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, file_name=None, parser_library=None, **keywords):
self.__file_name = file_name
if "force_file_type" in keywords:
file_type = keywords.get("force_file_type")
else:
file_type = self.__file_name.split(".")[-1]
self.__parser = PARSER.get_a_plugin(file_type, parser_library)
AbstractSource.__init__(self, **keywords)
def __init__(self, sheet_stream, **keywords):
self.__sheet_stream = sheet_stream
AbstractSource.__init__(self, **keywords)
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
AbstractSource.__init__(self, **keywords)
def __init__(
self,
file_content=None,
file_type=None,
file_stream=None,
parser_library=None,
**keywords
):
self.__file_type = file_type
self.__file_stream = file_stream
self.__file_content = file_content
self.__parser = PARSER.get_a_plugin(file_type, parser_library)
AbstractSource.__init__(self, **keywords)
def __init__(self, file_name=None, renderer_library=None, **keywords):
AbstractSource.__init__(self, **keywords)
self._file_name = file_name
if "force_file_type" in keywords:
file_type = keywords.get("force_file_type")
else:
file_type = find_file_type_from_file_name(file_name, "write")
self._renderer = RENDERER.get_a_plugin(file_type, renderer_library)
def __init__(self, array, sheet_name=DEFAULT_SHEET_NAME, **keywords):
self.__array = array
self._content = _FakeIO()
self.__sheet_name = sheet_name
AbstractSource.__init__(self, **keywords)
def __init__(self, records, sheet_name=DEFAULT_SHEET_NAME, **keywords):
self.__records = records
self._content = _FakeIO()
self.__sheet_name = sheet_name
AbstractSource.__init__(self, **keywords)
def __init__(
self, db_type, parser_library=None, renderer_library=None, **keywords
):
self.__db_type = db_type
self.__parser_library = parser_library
self.__renderer_library = renderer_library
AbstractSource.__init__(self, **keywords)
def __init__(
self,
file_type=None,
file_stream=None,
renderer_library=None,
**keywords
):
AbstractSource.__init__(self, **keywords)
self._renderer = RENDERER.get_a_plugin(file_type, renderer_library)
if file_stream:
self._content = file_stream
else:
self._content = self._renderer.get_io()
self.attributes = RENDERER.get_all_file_types()