<commit_before>#! /usr/bin/env python2
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Ciel <<EMAIL>>
#
# Distributed under terms of the MIT license.

import os, sys

userpath = os.path.expanduser('~') + '/.git-ignore-templates/'
syspath = sys.path[0] + "/system-templates/"
githubpath = sys.path[0] + "/github-templates/"

# get file list in three search paths
def filelist():
	try:
		usertemplates = os.listdir(userpath)
	except OSError:
		os.mkdir(userpath)
		usertemplates = os.listdir(userpath)
	try:
		systemplates = os.listdir(syspath)
	except OSError:
		os.mkdir(syspath)
		systemplates = os.listdir(syspath)
	try:
		githubtemplates = os.listdir(githubpath)
	except OSError:
		githubtemplates = []

	return (usertemplates, systemplates, githubtemplates)

# search file
def searchfile(language, templates):
	language = language.lower() + ".gitignore"
	for template in templates:
		if language == template.lower():
			return template
	return ""

# create ignore file path list
def ignorelist(languages):
	user, system, github = filelist()
	ignorelist = []<commit_msg>rm usertemplates.<commit_after>#! /usr/bin/env python2
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 Ciel <<EMAIL>>
#
# Distributed under terms of the MIT license.

import os, sys

userpath = os.path.expanduser('~') + '/.git-ignores/'
syspath = sys.path[0] + "/system-templates/"
githubpath = sys.path[0] + "/github-templates/"

# get file list in three search paths
def filelist():
	try:
		usertemplates = os.listdir(userpath)
	except OSError:
		usertemplates = []
	try:
		systemplates = os.listdir(syspath)
	except OSError:
		os.mkdir(syspath)
		systemplates = os.listdir(syspath)
	try:
		githubtemplates = os.listdir(githubpath)
	except OSError:
		githubtemplates = []

	return (usertemplates, systemplates, githubtemplates)

# search file
def searchfile(language, templates):
	language = language.lower() + ".gitignore"
	for template in templates:
		if language == template.lower():
			return template
	return ""

# create ignore file path list
def ignorelist(languages):
	user, system, github = filelist()
	ignorelist = []
{'fraction_non_alphanumeric': 0.13427230046948357, 'fraction_numerical': 0.008450704225352112, 'mean_word_length': 4.39493670886076, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5071397', 'n_tokens_mistral': 761, 'n_tokens_neox': 715, 'n_words': 189}