Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90495208
importer.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 2, 04:41
Size
1 KB
Mime Type
text/x-python
Expires
Mon, Nov 4, 04:41 (2 d)
Engine
blob
Format
Raw Data
Handle
22086478
Attached To
rPHAPI Phabricator API scripts
importer.py
View Options
# -*- 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
Log In to Comment