#!/usr/bin/env python
# -*- coding: utf-8 -*-


def rename_kv_file():
    """Rename the generated kv file to be compatible with the original kivy kv
    file detection of `App.load_kv`.
    """
    import os
    package_dir = '{{cookiecutter.repo_name}}'
    old_kv_file = os.path.join(
        package_dir, '{{cookiecutter.app_class_name}}.kv'
    )

    lower_app_class_name = '{{cookiecutter.app_class_name}}'.lower()
    if (lower_app_class_name.endswith('app')):
        lower_app_class_name = lower_app_class_name[:-3]
    new_kv_file = os.path.join(
        package_dir, '{}.kv'.format(lower_app_class_name)
    )

    os.rename(old_kv_file, new_kv_file)



def generate_i18n_locales():
    """Run 'make mo' to generate the locales from the po files. The app won't
    run without the translation files.
    """
    import logging
    import subprocess
    try:
        subprocess.check_call(['make', 'mo'])
    except subprocess.CalledProcessError:
        logging.warning('Unable to create i18n translation files.')


rename_kv_file()
generate_i18n_locales()

@@ -40,16 +40,120 @@
 -8 -*-%0A%0A
+import logging%0Alogging.basicConfig(level=logging.DEBUG)%0Alogger = logging.getLogger('post_gen_project')%0A%0A
 %0Adef ren
@@ -283,32 +283,69 @@
 ad_kv%60.%0A    %22%22%22%0A
+    logger.info('Renaming kv file')%0A%0A
     import os%0A  
@@ -798,17 +798,16 @@
 file)%0A%0A%0A
-%0A
 def gene
@@ -956,30 +956,65 @@
 %22%22%22%0A    
-import logging
+logger.info('Generating i18n translation files')%0A
 %0A    imp
@@ -1137,19 +1137,18 @@
     logg
-ing
+er
 .warning

Implement logging in post_gen_project.py