Page MenuHomec4science

__init__.py
No OneTemporary

File Metadata

Created
Sat, Nov 23, 23:10

__init__.py

# -*- 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