Page MenuHomec4science

importer.py
No OneTemporary

File Metadata

Created
Sat, Nov 2, 04:41

importer.py

# -*- coding: utf-8 -*-
import logging
import copy
from .. import export
from .. import colored
__author__ = "Nicolas Richart"
__copyright__ = "Copyright (C) 2016, EPFL (Ecole Polytechnique Fédérale " \
"de Lausanne) - SCITAS (Scientific IT and Application " \
"Support)"
__credits__ = ["Nicolas Richart"]
__license__ = "BSD"
__version__ = "0.1"
__maintainer__ = "Nicolas Richart"
__email__ = "nicolas.richart@epfl.ch"
_logger = logging.getLogger(__name__)
@export
class Importer:
def __init__(self, name, config, default_import_scheme, **kwargs):
self._config = copy.copy(config)
self._name = name
self._colored_name = colored(self._name, 'grey', attrs=['bold'])
opts = copy.copy(kwargs)
self._dry_run = opts.pop("dry_run", False)
self._keyring = opts.pop("keyring", None)
self._user_db = opts.pop("user_db", None)
self._backend_in = opts.pop("backend_in", None)
self._backend_out = opts.pop("backend_out", None)
if 'import-scheme' not in self._config:
self._config['import-scheme'] = default_import_scheme
else:
for k, v in default_import_scheme.items():
if k not in self._config['import-scheme']:
self._config['import-scheme'][k] = v

Event Timeline