from .. import DEFAULT_CONFIG_DIR
from .. import DEFAULT_TERMINAL_HEIGHT, DEFAULT_TERMINAL_WIDTH
from .. import __version__ as GLOBAL_VERSION
-from ..xlate import XLATOR
+from ..xlate import DOMAIN, LOCALE_DIR, XLATOR
+from ..xlate import __base_dir__ as __xlate_base_dir__
+from ..xlate import __lib_dir__ as __xlate_lib_dir__
+from ..xlate import __mo_file__ as __xlate_mo_file__
+from ..xlate import __module_dir__ as __xlate_module_dir__
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-__version__ = '0.6.5'
+__version__ = '0.7.0'
# =============================================================================
env_prefix=env_prefix, config_dir=config_dir
)
+ # -------------------------------------------------------------------------
+ def as_dict(self, short=True):
+ """
+ Transform the elements of the object into a dict.
+
+ @param short: don't include local properties in resulting dict.
+ @type short: bool
+
+ @return: structure as dict
+ @rtype: dict
+ """
+ res = super(BaseDPXApplication, self).as_dict(short=short)
+
+ if 'xlate' not in res:
+ res['xlate'] = {}
+ res['xlate'][DOMAIN] = {
+ '__module_dir__': __xlate_module_dir__,
+ '__lib_dir__': __xlate_lib_dir__,
+ '__base_dir__': __xlate_base_dir__,
+ 'LOCALE_DIR': LOCALE_DIR,
+ 'DOMAIN': DOMAIN,
+ '__mo_file__': __xlate_mo_file__,
+ }
+
+ return res
+
# -------------------------------------------------------------------------
def line(self, width=None, linechar='-', color=None):
"""Print out an line on stdout, if not in quiet mode."""