<commit_before>package play

import (
	"path"
	"path/filepath"
	"log"
	"os"
	"strings"
)

var (
	// App details
	AppName    string  // e.g. "sample"
	BasePath   string  // e.g. "/Users/robfig/gocode/src/play/sample"
	AppPath    string  // e.g. "/Users/robfig/gocode/src/play/sample/app"
	ViewsPath  string  // e.g. "/Users/robfig/gocode/src/play/sample/app/views"
	ImportPath string  // e.g. "play/sample"

	// Play installation details
	PlayTemplatePath string = "/Users/robfig/code/gocode/src/play/app/views"

	LOG = log.New(os.Stdout, "", log.Ldate | log.Ltime | log.Lshortfile)

	// Private
	playInit bool = false
)

func Init(basePath string) {
	AppName = filepath.Base(basePath)
	BasePath = basePath
	AppPath = path.Join(BasePath, "app")
	ViewsPath = path.Join(AppPath, "views")
	ImportPath = getImportPath(basePath)

	playInit = true
}
<commit_msg>Dynamically find the Play template directory -- no more hardcoded configuration for my machine!<commit_after>package play

import (
	"path"
	"path/filepath"
	"log"
	"os"
	"strings"
)

var (
	// App details
	AppName    string  // e.g. "sample"
	BasePath   string  // e.g. "/Users/robfig/gocode/src/play/sample"
	AppPath    string  // e.g. "/Users/robfig/gocode/src/play/sample/app"
	ViewsPath  string  // e.g. "/Users/robfig/gocode/src/play/sample/app/views"
	ImportPath string  // e.g. "play/sample"

	// Play installation details
	PlayTemplatePath string  // e.g. "/Users/robfig/gocode/src/play/app/views"

	LOG = log.New(os.Stdout, "", log.Ldate | log.Ltime | log.Lshortfile)

	// Private
	playInit bool = false
)

func Init(basePath string) {
	AppName = filepath.Base(basePath)
	BasePath = basePath
	AppPath = path.Join(BasePath, "app")
	ViewsPath = path.Join(AppPath, "views")
	ImportPath = getImportPath(basePath)
	PlayTemplatePath = FindSource("play/app/views")

	playInit = true
}

{'fraction_non_alphanumeric': 0.14650027129679868, 'fraction_numerical': 0.0, 'mean_word_length': 3.380047505938242, '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': '6823377', 'n_tokens_mistral': 707, 'n_tokens_neox': 697, 'n_words': 141}