diff --git a/getmystuph/__init__.py b/getmystuph/__init__.py index 1e56633..a8f4cd8 100644 --- a/getmystuph/__init__.py +++ b/getmystuph/__init__.py @@ -1,56 +1,58 @@ # -*- coding: utf-8 -*- ''' @package getmystuph @file __init__.py @copyright BSD @author Nicolas Richart @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 + from colorama import init + init() 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 diff --git a/requirements.txt b/requirements.txt index 1086120..c25d380 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,10 @@ keyring ldap3 bs4 phabricator pyyaml gitpython svn termcolor requests +colorama