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

# Copyright 2012 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

'''
TODO : ability to split chapters into several files
TODO : manage keyword locality (server/proxy/global ; ex : maxconn)
'''
import os, sys, cgi, re
import time
import datetime

from mako.template import Template

VERSION = "0.0.1"

context = {
	'headers':	{},
	'document':	""
}

def getTitleDetails(string):
	array = string.split(".")<commit_msg>Determine the version from git<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright 2012 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

'''
TODO : ability to split chapters into several files
TODO : manage keyword locality (server/proxy/global ; ex : maxconn)
'''
import os, subprocess, sys, cgi, re
import time
import datetime

from mako.template import Template

VERSION = "0.0.1"

# Temporarly determine the version from git to follow which commit generated
# the documentation
def get_git_version():
	global VERSION
	if not os.path.isdir(".git"):
		print >> sys.stderr, "This does not appear to be a Git repository."
		return
	try:
		p = subprocess.Popen(["git", "describe", "--tags", "--match", "v*"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
	except EnvironmentError:
		print >> sys.stderr, "Unable to run git"
		return
	version = p.communicate()[0]
	if p.returncode != 0:
		print >> sys.stderr, "Unable to run git"
		return
		
	if len(version) < 2:
		return
		
	version = version[1:].strip()
	return version

VERSION = get_git_version()
if not VERSION:
	sys.exit(1)

context = {
	'headers':	{},
	'document':	""
}

def getTitleDetails(string):
	array = string.split(".")
{'fraction_non_alphanumeric': 0.11177347242921014, 'fraction_numerical': 0.010804769001490314, 'mean_word_length': 4.193423597678917, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '458767', 'n_tokens_mistral': 815, 'n_tokens_neox': 787, 'n_words': 324}