コード例 #1
0
ファイル: setup.py プロジェクト: harlo/CompassFrontend
	
	if dc_ask and 'documentcloud_auth_str' not in config.keys():
		print "****************************"
		print "Link DocumentCloud account?  y or n?"
		use_dc = prompt("[DEFAULT: n]")
		
		if use_dc == "y":
			dc_user = prompt("Username: "******"Password: "******"%s:%s@" % (dc_user.replace("@", "%40"),
				dc_pwd)
	
	with open(os.path.join(COMPASS_CONF_ROOT, "compass.init.json"), 'wb+') as WEB:
		WEB.write(json.dumps({
			'web' : {
				'BATCH_SALT' : generateNonce(),
				"DEFAULT_STOPWORDS" : {
					"english" : [
						"a", "about", "above", "above", "across", "after", 
						"afterwards", "again", "against", "all", "almost", 
						"alone", "along", "already", "also","although","always","am",
						"among", "amongst", "amoungst", "amount", "an", 
						"and", "another", "any","anyhow","anyone","anything",
						"anyway", "anywhere", "are", "around", "as", "at",
						"back","be","became", "because","become","becomes",
						"becoming", "been", "before", "beforehand", "behind", 
						"being", "below", "beside", "besides", "between", 
						"beyond", "bill", "both", "bottom","but", "by", "call", 
						"can", "cannot", "cant", "co", "con", "could", "couldnt", 
						"cry", "de", "describe", "detail", "do", "done", "down", 
						"due", "during", "each", "eg", "eight", "either", "eleven",
コード例 #2
0
import os, json
from sys import exit

from lib.Frontend.lib.Core.Utils.funcs import generateNonce
from conf import CONF_ROOT, INFORMA_CONF_ROOT

if __name__ == "__main__":
	default_home_mime_types = ["image/jpeg", "video/x-matroska"]

	try:
		with open(os.path.join(CONF_ROOT, "unveillance.secrets.json"), 'rb') as CONF:
			config = json.loads(CONF.read())

		if 'web_home_mime_types' in config.keys():
			default_home_mime_types = config['web_home_mime_types']
	except Exception as e:
		print "NO CONF?"	
	
	with open(os.path.join(INFORMA_CONF_ROOT, "informacam.init.json"), 'wb+') as WEB:
		WEB.write(json.dumps({
			'web' : {
				'BATCH_SALT' : generateNonce(),
				'DEFAULT_HOME_MIME_TYPES' : default_home_mime_types
			}
		}))
		
	exit(0)