<commit_before>import errno
import os
import socket
import subprocess
import sys

from paste.script import templates
from zopeskel.base import BadCommand
from zopeskel.base import var

plone25s = {
        "2.5.5": "https://launchpad.net/plone/2.5/2.5.5/+download/Plone-2.5.5.tar.gz",
        "2.5.4": "https://launchpad.net/plone/2.5/2.5.4/+download/Plone-2.5.4-2.tar.gz",
        "2.5.3": "https://launchpad.net/plone/2.5/2.5.3/+download/Plone-2.5.3-final.tar.gz",
        "2.5.2": "http://plone.googlecode.com/files/Plone-2.5.2-1.tar.gz",
        "2.5.1": "http://heanet.dl.sourceforge.net/sourceforge/plone/Plone-2.5.1-final.tar.gz",
        "2.5"  : "http://heanet.dl.sourceforge.net/sourceforge/plone/Plone-2.5.tar.gz",
        }

class StandardHosting(templates.Template):
    _template_dir = "templates/plone_hosting"
    use_cheetah = True
    summary = "Plone hosting: buildout with ZEO and any Plone version"
    required_templates = []

    vars = [
            var("zope_password", "<PASSWORD>", default="<PASSWORD>"),
            var("base_port", "Base port number", default=8000),
            var("proxy", "Install a proxy server", default="no"),
            var("plone", "Plone version (2.5, 2.5.1, 3.0, 3.0.1, etc.)",
                default="3.1.4"),
            var("buildout", "Run buildout", default="yes"),
            ]

    def _buildout(self, output_dir):
        olddir=os.getcwd()
        try:
            os.chdir(output_dir)
            print "Bootstrapping the buildout"
            subprocess.call([sys.executable, "bootstrap.py"])
            print "Configuring the buildout"
            subprocess.call(["bin/buildout", "-n"])<commit_msg>moved inheritance for hosting template to the ZopeSkel BaseTemplate class.  We believe all templates that are part of ZopeSkel should do this.<commit_after>import errno
import os
import socket
import subprocess
import sys
import copy

from paste.script import templates
from zopeskel.base import BadCommand
from zopeskel.base import BaseTemplate
from zopeskel.vars import var

plone25s = {
        "2.5.5": "https://launchpad.net/plone/2.5/2.5.5/+download/Plone-2.5.5.tar.gz",
        "2.5.4": "https://launchpad.net/plone/2.5/2.5.4/+download/Plone-2.5.4-2.tar.gz",
        "2.5.3": "https://launchpad.net/plone/2.5/2.5.3/+download/Plone-2.5.3-final.tar.gz",
        "2.5.2": "http://plone.googlecode.com/files/Plone-2.5.2-1.tar.gz",
        "2.5.1": "http://heanet.dl.sourceforge.net/sourceforge/plone/Plone-2.5.1-final.tar.gz",
        "2.5"  : "http://heanet.dl.sourceforge.net/sourceforge/plone/Plone-2.5.tar.gz",
        }

class StandardHosting(BaseTemplate):
    _template_dir = "templates/plone_hosting"
    use_cheetah = True
    summary = "Plone hosting: buildout with ZEO and any Plone version"
    required_templates = []

    vars = copy.deepcopy(BaseTemplate.vars);
    vars = [
            var("zope_password", "Initial Zope admin password", default="<PASSWORD>"),
            var("base_port", "Base port number", default=8000),
            var("proxy", "Install a proxy server", default="no"),
            var("plone", "Plone version (2.5, 2.5.1, 3.0, 3.0.1, etc.)",
                default="3.1.4"),
            var("buildout", "Run buildout", default="yes"),
            ]

    def _buildout(self, output_dir):
        olddir=os.getcwd()
        try:
            os.chdir(output_dir)
            print "Bootstrapping the buildout"
            subprocess.call([sys.executable, "bootstrap.py"])
            print "Configuring the buildout"
            subprocess.call(["bin/buildout", "-n"])
{'fraction_non_alphanumeric': 0.1621017328116266, 'fraction_numerical': 0.03912800447177194, 'mean_word_length': 2.5682951146560318, 'pattern_counts': {'":': 10, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '767429', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1254, 'n_words': 227}