# Path: starterpyth/log.py
# RED = '31'
# 
# def display(text, color=None, bold=False, newline=True):
#     if not isinstance(text, text_type):
#         text = text.decode('utf-8')
#     if bold and color:
#         text = u("\033[1;{0}m{1}\033[0m").format(color, text)
#     text = u("\033[{0}m{1}\033[0m").format(color, text)
#     if newline:
#         text += u('\n')
#     end = u('')
#     if __encode_stdout:
#         text = text.encode('utf-8')
#         end = b('')
#     print_(text, end=end)
# 
# YELLOW = '33'
# 
# GREEN = '32'
# 
# Path: starterpyth/core.py
# def load_module(modulename):
#     parents = modulename.split('.')
#     path = sys.path
#     module = None
#     abs_module_name = ''
#     cwd = os.getcwd()
#     for module_name in parents:
#         (file_, pathname, description) = imp.find_module(module_name, path)
#         name_to_import = abs_module_name + module_name
#         if name_to_import in sys.modules:
#             module = sys.modules[name_to_import]
#         else:
#             module = imp.load_module(name_to_import, file_, pathname, description)
#         path = [os.path.dirname(module.__file__)]
#         abs_module_name += module_name + '.'
#     os.chdir(cwd)
#     return module
# 
# Path: starterpyth/translation.py
# def __find(domain, locale_module, localedir='locale', languages=None):
# def translation(domain, locale_module, localedir='locale', languages=None, class_=None, fallback=False):
# __TRANS = translation(parent_package, parent_package, fallback=True)


import codecs
import datetime
import os
import subprocess
from distutils.core import Command
from starterpyth.log import RED, display, YELLOW, GREEN
    from jinja2 import Environment, PackageLoader
from setuptools import find_packages
from starterpyth.core import load_module
from starterpyth.translation import gettext as _
            'copyright': self.distribution.get_author(),
            'package': None,
            'author': self.distribution.get_author(),
            'version': self.distribution.get_version(),
            'email': self.distribution.get_author_email(),
            'year': datetime.datetime.now().year,
        }
        for tl_name in top_levels_modules.keys():
            dst_abs_path = os.path.join(top_levels_modules[tl_name], dst_rel_path)
            domain = self.domain or tl_name
            pot_filename = os.path.join(dst_abs_path, '%s.pot' % domain)
            po_filename = os.path.join(dst_abs_path, self.language, 'LC_MESSAGES', '%s.po' % domain)
            if not os.path.isdir(os.path.dirname(po_filename)):
                os.makedirs(os.path.dirname(po_filename))
            for filename in (pot_filename, po_filename):
                if not os.path.isfile(filename):
                    context['package'] = tl_name
                    po_fd = codecs.open(filename, 'w', encoding='utf-8')
                    po_fd.write(template.render(context))
                    po_fd.close()
        for tl_name, module_names in all_modules.items():
            dst_abs_path = os.path.join(top_levels_modules[tl_name], dst_rel_path)
            root_path = os.path.dirname(top_levels_modules[tl_name])
            display(root_path)
            domain = self.domain or tl_name
            pot_filename = os.path.join(dst_abs_path, '%s.pot' % domain)
            po_filename = os.path.join(dst_abs_path, self.language, 'LC_MESSAGES', '%s.po' % domain)
            # build the list of files to examine, for each top-level module
            filenames = []
            for module_name in module_names:

# Path: starterpyth/log.py
# RED = '31'
# 
# def display(text, color=None, bold=False, newline=True):
#     if not isinstance(text, text_type):
#         text = text.decode('utf-8')
#     if bold and color:
#         text = u("\033[1;{0}m{1}\033[0m").format(color, text)
#     text = u("\033[{0}m{1}\033[0m").format(color, text)
#     if newline:
#         text += u('\n')
#     end = u('')
#     if __encode_stdout:
#         text = text.encode('utf-8')
#         end = b('')
#     print_(text, end=end)
# 
# YELLOW = '33'
# 
# GREEN = '32'
# 
# Path: starterpyth/core.py
# def load_module(modulename):
#     parents = modulename.split('.')
#     path = sys.path
#     module = None
#     abs_module_name = ''
#     cwd = os.getcwd()
#     for module_name in parents:
#         (file_, pathname, description) = imp.find_module(module_name, path)
#         name_to_import = abs_module_name + module_name
#         if name_to_import in sys.modules:
#             module = sys.modules[name_to_import]
#         else:
#             module = imp.load_module(name_to_import, file_, pathname, description)
#         path = [os.path.dirname(module.__file__)]
#         abs_module_name += module_name + '.'
#     os.chdir(cwd)
#     return module
# 
# Path: starterpyth/translation.py
# def __find(domain, locale_module, localedir='locale', languages=None):
# def translation(domain, locale_module, localedir='locale', languages=None, class_=None, fallback=False):
# __TRANS = translation(parent_package, parent_package, fallback=True)


# Path: starterpyth/commands/makemessages.py
import codecs
import datetime
import os
import subprocess
from distutils.core import Command
from starterpyth.log import RED, display, YELLOW, GREEN
    from jinja2 import Environment, PackageLoader
from setuptools import find_packages
from starterpyth.core import load_module
from starterpyth.translation import gettext as _

            'copyright': self.distribution.get_author(),
            'package': None,
            'author': self.distribution.get_author(),
            'version': self.distribution.get_version(),
            'email': self.distribution.get_author_email(),
            'year': datetime.datetime.now().year,
        }
        for tl_name in top_levels_modules.keys():
            dst_abs_path = os.path.join(top_levels_modules[tl_name], dst_rel_path)
            domain = self.domain or tl_name
            pot_filename = os.path.join(dst_abs_path, '%s.pot' % domain)
            po_filename = os.path.join(dst_abs_path, self.language, 'LC_MESSAGES', '%s.po' % domain)
            if not os.path.isdir(os.path.dirname(po_filename)):
                os.makedirs(os.path.dirname(po_filename))
            for filename in (pot_filename, po_filename):
                if not os.path.isfile(filename):
                    context['package'] = tl_name
                    po_fd = codecs.open(filename, 'w', encoding='utf-8')
                    po_fd.write(template.render(context))
                    po_fd.close()
        for tl_name, module_names in all_modules.items():
            dst_abs_path = os.path.join(top_levels_modules[tl_name], dst_rel_path)
            root_path = os.path.dirname(top_levels_modules[tl_name])
            display(root_path)
            domain = self.domain or tl_name
            pot_filename = os.path.join(dst_abs_path, '%s.pot' % domain)
            po_filename = os.path.join(dst_abs_path, self.language, 'LC_MESSAGES', '%s.po' % domain)
            # build the list of files to examine, for each top-level module
            filenames = []
            for module_name in module_names:

                init_filename = load_module(module_name).__file__