def handle_app(self, app, **options):
        directory = os.getcwd()
        app_name = app.__name__.split('.')[-2]
        project_dir = os.path.join(directory, app_name)
        if not os.path.exists(project_dir):
            try:
                os.mkdir(project_dir)
            except __HOLE__, e:
                raise CommandError(e)

        copy_template('command_template', project_dir, options.get('command_name'), '%sCommand' % options.get('base_command'))
dataset/ETHPy150Open mozilla/inventory/vendor-local/src/django-extensions/build/lib/django_extensions/management/commands/create_command.py/Command.handle_app