# Path: easymode/utils/languagecode.py
# def get_language_codes():
#     """
#     Retrieves all the language codes defined in ``settings.LANGUAGES``.
#     
#     >>> settings.LANGUAGES = (('en','English'),('de','German'),('nl-be','Belgium dutch'),('fr-be','Belgium french'),)
#     >>> sorted( get_language_codes() )
#     ['de', 'en', 'fr-be', 'nl-be']
#     
#     :rtype: A :class:`list` of language codes.
#     """
#     return dict(settings.LANGUAGES).keys()
# 
# Path: easymode/utils/polibext.py
# def po_to_unicode(po_obj):
#     def __init__(self, stream, fpath=None, encoding='utf-8', wrapwidth=78):
# class PoStream(polib._POFileParser):


import os
import re
import subprocess
import codecs
import logging
import StringIO
import unicodedata
import easymode.tree.introspection
    import polib
from datetime import datetime
from django.conf import settings
from django.core.management.base import CommandError
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import templatize, to_locale, get_language
    from django.utils.timezone import tzinfo
    from django.utils import tzinfo
from django.template.loader import render_to_string
from easymode.utils import mutex
from easymode.utils.languagecode import get_language_codes
from easymode.utils import polibext
            self.location = (hasattr(settings, 'LOCALE_DIR') and \
                settings.LOCALE_DIR) or settings.PROJECT_DIR
        elif os.path.isdir(location) is False and os.path.exists(location):
            self.location = os.path.dirname(location)
        else:
            self.location = location

        self.sender = sender


    def __call__(self, instance, sender=None, **kwargs):
        """
        Handler for the post_save signal.
        Will create a django.po file in each language,
        in the directory specified by self.location.
        """

        # no need to create translation files if not in the master site
        if not getattr(settings, 'MASTER_SITE', False):
            return

        if hasattr(instance, 'language') and instance.language != settings.LANGUAGE_CODE:
            return

        if get_language() != settings.LANGUAGE_CODE:
            return

        po_form = self.poify(instance)
        if po_form is not None:
            # for each language create a po file

# Path: easymode/utils/languagecode.py
# def get_language_codes():
#     """
#     Retrieves all the language codes defined in ``settings.LANGUAGES``.
#     
#     >>> settings.LANGUAGES = (('en','English'),('de','German'),('nl-be','Belgium dutch'),('fr-be','Belgium french'),)
#     >>> sorted( get_language_codes() )
#     ['de', 'en', 'fr-be', 'nl-be']
#     
#     :rtype: A :class:`list` of language codes.
#     """
#     return dict(settings.LANGUAGES).keys()
# 
# Path: easymode/utils/polibext.py
# def po_to_unicode(po_obj):
#     def __init__(self, stream, fpath=None, encoding='utf-8', wrapwidth=78):
# class PoStream(polib._POFileParser):


# Path: easymode/i18n/gettext.py
import os
import re
import subprocess
import codecs
import logging
import StringIO
import unicodedata
import easymode.tree.introspection
    import polib
from datetime import datetime
from django.conf import settings
from django.core.management.base import CommandError
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import templatize, to_locale, get_language
    from django.utils.timezone import tzinfo
    from django.utils import tzinfo
from django.template.loader import render_to_string
from easymode.utils import mutex
from easymode.utils.languagecode import get_language_codes
from easymode.utils import polibext

            self.location = (hasattr(settings, 'LOCALE_DIR') and \
                settings.LOCALE_DIR) or settings.PROJECT_DIR
        elif os.path.isdir(location) is False and os.path.exists(location):
            self.location = os.path.dirname(location)
        else:
            self.location = location

        self.sender = sender


    def __call__(self, instance, sender=None, **kwargs):
        """
        Handler for the post_save signal.
        Will create a django.po file in each language,
        in the directory specified by self.location.
        """

        # no need to create translation files if not in the master site
        if not getattr(settings, 'MASTER_SITE', False):
            return

        if hasattr(instance, 'language') and instance.language != settings.LANGUAGE_CODE:
            return

        if get_language() != settings.LANGUAGE_CODE:
            return

        po_form = self.poify(instance)
        if po_form is not None:
            # for each language create a po file

            for language in get_language_codes():