<commit_before>from honcho.export.base import BaseExport


class Export(BaseExport):
    def render(self, procfile, options, environment, concurrency):
        files = []

        context = {
            'app':         options.app,
            'app_root':    options.app_root,
            'environment': environment,
            'log':         options.log,
            'port':        options.port,
            'user':        options.user,
            'shell':       options.shell
        }

        for name, cmd in procfile.commands.iteritems():
            ctx = context.copy()
            ctx.update({'command': cmd,
                        'name':    name})

            master = "{}-{}.conf".format(options.app, name)
            master_content = self.get_template("process_master.conf").render(ctx)
            files.append((master, master_content))

            for num in xrange(1, concurrency[name] + 1):
                ctx.update({'num': num})
                process = "{}-{}-{}.conf".format(options.app, name, num)
                process_content = self.get_template("process.conf").render(ctx)
                files.append((process, process_content))

        app = "{}.conf".format(options.app)
        app_content = self.get_template("master.conf").render(context)

        files.append((app, app_content))

        return files<commit_msg>made format strings 2.6 compatible<commit_after>from honcho.export.base import BaseExport


class Export(BaseExport):
    def render(self, procfile, options, environment, concurrency):
        files = []

        context = {
            'app':         options.app,
            'app_root':    options.app_root,
            'environment': environment,
            'log':         options.log,
            'port':        options.port,
            'user':        options.user,
            'shell':       options.shell
        }

        for name, cmd in procfile.commands.iteritems():
            ctx = context.copy()
            ctx.update({'command': cmd,
                        'name':    name})

            master = "{0}-{1}.conf".format(options.app, name)
            master_content = self.get_template("process_master.conf").render(ctx)
            files.append((master, master_content))

            for num in xrange(1, concurrency[name] + 1):
                ctx.update({'num': num})
                process = "{0}-{1}-{2}.conf".format(options.app, name, num)
                process_content = self.get_template("process.conf").render(ctx)
                files.append((process, process_content))

        app = "{0}.conf".format(options.app)
        app_content = self.get_template("master.conf").render(context)

        files.append((app, app_content))

        return files
{'fraction_non_alphanumeric': 0.13253012048192772, 'fraction_numerical': 0.004381161007667032, 'mean_word_length': 1.824742268041237, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3591965', 'n_tokens_mistral': 752, 'n_tokens_neox': 718, 'n_words': 143}