# Path: mamba/copyright.py

# 
# Path: mamba/_version.py

# 
# Path: mamba/utils/checkers.py
# class Checkers(object):
#     """Just implement common methods to perform checks on user inputs
# 
#     .. versionadded:: 0.3.6
#     """
# 
#     NONE, CAPS, NUMERIC, SYMBOLS = [1 << i for i in range(4)]
#     MIN_LENGTH, NO_CAPS, NO_NUMBERS, NO_SYMBOLS = range(4)
# 
#     def __init__(self):
#         super(Checkers, self).__init__()
# 
#     @staticmethod
#     def check_email(email):
#         """Checks if the given email is RFC2822 compliant
# 
#         http://www.rfc-editor.org/rfc/rfc2822.txt
#         """
# 
#         RFC2822 = re.compile(
#             r"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*"
#             "+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9]"
#             ")?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"
#         )
#         return True if RFC2822.match(email) is not None else False
# 
#     @staticmethod
#     def check_password(password, min_length=8, characters=NONE):
#         """Check for valid password using the given parameters
# 
#         :param password: the password to check
#         :type password: str
#         :param min_length: minimum password length (default 8)
#         :type min_length: int
#         :param characters: the valid cahracters to be used.
#             A complete list of the possible options is as follows:
# 
#                 * CAPS: Whatever can be used, we force some cap
#                 * NUMERIC: Whatever can be used, we force numbers
#                 * SYMBOLS: Whatever can be used, we force symbols
# 
#         :returns: a tuple containing a boolean value and a list of dicts
#         """
# 
#         errors = []
#         if len(password) < min_length:
#             errors.append({
#                 'eng_desc': 'Minimum length is {}, but {} given'.format(
#                     min_length, len(password)),
#                 'type': Checkers.MIN_LENGTH,
#                 'data': {'min_length': min_length, 'given': len(password)}
#             })
# 
#         if characters & Checkers.CAPS > 0:
#             if len(filter(str.isupper, password)) == 0:
#                 errors.append({
#                     'eng_desc': 'String must contain caps',
#                     'type': Checkers.NO_CAPS
#                 })
# 
#         if characters & Checkers.NUMERIC > 0:
#             if len(filter(str.isdigit, password)) == 0:
#                 errors.append({
#                     'eng_desc': 'String must comntain numbers',
#                     'type': Checkers.NO_NUMBERS
#                 })
# 
#         if characters & Checkers.SYMBOLS > 0:
#             if len(filter(lambda x: x in string.punctuation, password)) == 0:
#                 errors.append({
#                     'eng_desc': 'String must comntain symbols',
#                     'type': Checkers.NO_SYMBOLS
#                 })
# 
#         return len(errors) == 0, errors
# 
# Path: mamba/utils/output.py
# def resetColor():
# def style_to_ansi_code(style):
# def colorize(color_key, text):
# def create_color_func(color):
#     def closure(*args):


import os
import sys
import zipfile
import tarfile
import getpass
import subprocess
    import pip
from string import Template
from twisted.python import usage, filepath
from mamba import copyright
from mamba.scripts import commons
from mamba._version import versions
from mamba.utils import json
from mamba.utils.checkers import Checkers
from mamba.utils.output import darkred, darkgreen
                from setuptools.command.easy_install import main
            except ValueError:
                raise usage.UsageError(
                    'invalid JSON entry_points structure')

            if type(self['entry_points']) is not dict:
                raise usage.UsageError(
                    'the entry_points JSON string must be decoded as a dict')
        else:
            self['entry_points'] = {}

        if self['extra_directories'] is not None:
            try:
                self['extra_directories'] = json.loads(
                    self['extra_directories'])
            except ValueError:
                raise usage.UsageError(
                    'invalid JSON extra_directories structure')

            if type(self['extra_directories']) is not list:
                raise usage.UsageError(
                    'the extra_directories JSON string '
                    'must be decoded as a list'
                )
        else:
            self['extra_directories'] = []

        if self['author'] is None:
            self['author'] = getpass.getuser()

        if self['email'] is not None:

# Path: mamba/copyright.py

# 
# Path: mamba/_version.py

# 
# Path: mamba/utils/checkers.py
# class Checkers(object):
#     """Just implement common methods to perform checks on user inputs
# 
#     .. versionadded:: 0.3.6
#     """
# 
#     NONE, CAPS, NUMERIC, SYMBOLS = [1 << i for i in range(4)]
#     MIN_LENGTH, NO_CAPS, NO_NUMBERS, NO_SYMBOLS = range(4)
# 
#     def __init__(self):
#         super(Checkers, self).__init__()
# 
#     @staticmethod
#     def check_email(email):
#         """Checks if the given email is RFC2822 compliant
# 
#         http://www.rfc-editor.org/rfc/rfc2822.txt
#         """
# 
#         RFC2822 = re.compile(
#             r"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*"
#             "+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9]"
#             ")?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"
#         )
#         return True if RFC2822.match(email) is not None else False
# 
#     @staticmethod
#     def check_password(password, min_length=8, characters=NONE):
#         """Check for valid password using the given parameters
# 
#         :param password: the password to check
#         :type password: str
#         :param min_length: minimum password length (default 8)
#         :type min_length: int
#         :param characters: the valid cahracters to be used.
#             A complete list of the possible options is as follows:
# 
#                 * CAPS: Whatever can be used, we force some cap
#                 * NUMERIC: Whatever can be used, we force numbers
#                 * SYMBOLS: Whatever can be used, we force symbols
# 
#         :returns: a tuple containing a boolean value and a list of dicts
#         """
# 
#         errors = []
#         if len(password) < min_length:
#             errors.append({
#                 'eng_desc': 'Minimum length is {}, but {} given'.format(
#                     min_length, len(password)),
#                 'type': Checkers.MIN_LENGTH,
#                 'data': {'min_length': min_length, 'given': len(password)}
#             })
# 
#         if characters & Checkers.CAPS > 0:
#             if len(filter(str.isupper, password)) == 0:
#                 errors.append({
#                     'eng_desc': 'String must contain caps',
#                     'type': Checkers.NO_CAPS
#                 })
# 
#         if characters & Checkers.NUMERIC > 0:
#             if len(filter(str.isdigit, password)) == 0:
#                 errors.append({
#                     'eng_desc': 'String must comntain numbers',
#                     'type': Checkers.NO_NUMBERS
#                 })
# 
#         if characters & Checkers.SYMBOLS > 0:
#             if len(filter(lambda x: x in string.punctuation, password)) == 0:
#                 errors.append({
#                     'eng_desc': 'String must comntain symbols',
#                     'type': Checkers.NO_SYMBOLS
#                 })
# 
#         return len(errors) == 0, errors
# 
# Path: mamba/utils/output.py
# def resetColor():
# def style_to_ansi_code(style):
# def colorize(color_key, text):
# def create_color_func(color):
#     def closure(*args):


# Path: mamba/scripts/_package.py
import os
import sys
import zipfile
import tarfile
import getpass
import subprocess
    import pip
from string import Template
from twisted.python import usage, filepath
from mamba import copyright
from mamba.scripts import commons
from mamba._version import versions
from mamba.utils import json
from mamba.utils.checkers import Checkers
from mamba.utils.output import darkred, darkgreen
                from setuptools.command.easy_install import main

            except ValueError:
                raise usage.UsageError(
                    'invalid JSON entry_points structure')

            if type(self['entry_points']) is not dict:
                raise usage.UsageError(
                    'the entry_points JSON string must be decoded as a dict')
        else:
            self['entry_points'] = {}

        if self['extra_directories'] is not None:
            try:
                self['extra_directories'] = json.loads(
                    self['extra_directories'])
            except ValueError:
                raise usage.UsageError(
                    'invalid JSON extra_directories structure')

            if type(self['extra_directories']) is not list:
                raise usage.UsageError(
                    'the extra_directories JSON string '
                    'must be decoded as a list'
                )
        else:
            self['extra_directories'] = []

        if self['author'] is None:
            self['author'] = getpass.getuser()

        if self['email'] is not None:

            if not Checkers.check_email(self['email']):