Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92819745
__init__.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 23, 23:10
Size
1 KB
Mime Type
text/x-python
Expires
Mon, Nov 25, 23:10 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
22492684
Attached To
rPHAPI Phabricator API scripts
__init__.py
View Options
# -*- coding: utf-8 -*-
'''
@package getmystuph
@file __init__.py
@copyright BSD
@author Nicolas Richart <nicolas.richart@epfl.ch>
@section COPYRIGHT
Copyright (©) 2015 EPFL (Ecole Polytechnique Fédérale de Lausanne)
SCITAS - Scientific IT and Application Support
This file is part of getmystuph
'''
import
sys
as
__gms_sys
def
export
(
definition
):
"""
Decorator to export definitions from sub-modules to the top-level package
:param definition: definition to be exported
:return: definition
"""
__module
=
__gms_sys
.
modules
[
definition
.
__module__
]
__pkg
=
__gms_sys
.
modules
[
__module
.
__package__
]
__pkg
.
__dict__
[
definition
.
__name__
]
=
definition
if
'__all__'
not
in
__pkg
.
__dict__
:
__pkg
.
__dict__
[
'__all__'
]
=
[]
__pkg
.
__all__
.
append
(
definition
.
__name__
)
return
definition
color_code
=
{
'user'
:
'blue'
,
'group'
:
'green'
,
'repo'
:
'red'
}
try
:
from
termcolor
import
colored
except
ImportError
:
# noinspection PyUnusedLocal
def
colored
(
string
,
*
args
,
**
kwargs
):
return
string
__all__
=
[
'colored'
]
@export
def
dry_do
(
msg
):
print
(
'{0}: {1}'
.
format
(
colored
(
'WD'
,
'blue'
,
attrs
=
[
'bold'
]),
msg
))
from
.
import
directory
# noqa : F401
from
.
import
repo
# noqa : F401
from
.
import
backends
# noqa : F401
Event Timeline
Log In to Comment