<commit_before>import sys, os, random, cmd, locale, pprint, shlex, json, Queue
from shared import date_rewrite, path_rewrite

print("""Orphilia
<NAME>, 2010-2013
made with Dropbox SDK from https://www.dropbox.com/developers/reference/sdk \n""")

####################### initialize Dropbox API #
################################################
###############################################
from dropbox import client, rest, session
APP_KEY = '<KEY>'
APP_SECRET = '<KEY>'
ACCESS_TYPE = 'dropbox'
SDK_VERSION = "1.5"

# check if I specified app_key and app_secret	
if APP_KEY == '' or APP_SECRET == '':
	exit(' x You need to set your APP_KEY and APP_SECRET!')

############### read settings, get things done #
################################################
###############################################
def getConfigurationDirectory():
	home = os.path.expanduser('~')
	if sys.platform[:5] == 'haiku':
		configurationDirectory = os.path.normpath(home + '/config/settings/Orphilia/')
	elif sys.platform[:3] == 'win':
		configurationDirectory = os.path.normpath(home + '/AppData/Roaming/Orphilia/')
	else:
		configurationDirectory = os.path.normpath(home + '/.orphilia/')
	return configurationDirectory

configurationDirectory = getConfigurationDirectory()

def getDropboxPath():
	try:
		open(os.path.normpath(configurationDirectory+'/dropbox-path'), 'r')
	except:
		print(' ! Dropbox folder path not specified. Run configuration utility')
		dropboxPath = os.path.normpath(os.path.expanduser('~') + '/Dropbox')
	else:
		dropboxPathSetting = open(os.path.normpath(configurationDirectory+'/dropbox-path'), 'r')
		dropboxPath = dropboxPathSetting.read()
		dropboxPathSetting.close()
	return dropboxPath

def getAccountUID():
	try:
		open(os.path.normpath(configurationDirectory+'/dropbox-id'), 'r')
	except:
		print(' ! Account UID unknown. Public links may work unproperly. Run configuration utility')
		dropboxUID = 0
	else:
		dropboxUIDSetting = open(os.path.normpath(configurationDirectory+'/dropbox-id'), 'r')
		dropboxUID = dropboxUIDSetting.read()
		dropboxUIDSetting.close()
	return dropboxUID

def getNotifier():
	try:
		open(os.path.normpath(configurationDirectory+'/notify-settings'), 'r')
	except:
		print(' ! Notifier not specified. Run configuration utility')
		notifier = ''
	else:
		notifierSetting = open(os.path.normpath(configurationDirectory+'/notify-settings'), 'r')
		notifier = notifierSetting.read()
		notifierSetting.close()
	return notifier

dropboxPath = getDropboxPath()
accountUID = getAccountUID()
notifier = getNotifier()

delta_switch = 0<commit_msg>Shorter public link error<commit_after>import sys, os, random, cmd, locale, pprint, shlex, json, Queue
from shared import date_rewrite, path_rewrite

print("""Orphilia
<NAME>, 2010-2013
made with Dropbox SDK from https://www.dropbox.com/developers/reference/sdk \n""")

####################### initialize Dropbox API #
################################################
###############################################
from dropbox import client, rest, session
APP_KEY = 'ij4b7rjc7tsnlj4'
APP_SECRET = '00evf045y00ml2e'
ACCESS_TYPE = 'dropbox'
SDK_VERSION = "1.5"

# check if I specified app_key and app_secret	
if APP_KEY == '' or APP_SECRET == '':
	exit(' x You need to set your APP_KEY and APP_SECRET!')

############### read settings, get things done #
################################################
###############################################
def getConfigurationDirectory():
	home = os.path.expanduser('~')
	if sys.platform[:5] == 'haiku':
		configurationDirectory = os.path.normpath(home + '/config/settings/Orphilia/')
	elif sys.platform[:3] == 'win':
		configurationDirectory = os.path.normpath(home + '/AppData/Roaming/Orphilia/')
	else:
		configurationDirectory = os.path.normpath(home + '/.orphilia/')
	return configurationDirectory

configurationDirectory = getConfigurationDirectory()

def getDropboxPath():
	try:
		open(os.path.normpath(configurationDirectory+'/dropbox-path'), 'r')
	except:
		print(' ! Dropbox folder path not specified. Run configuration utility')
		dropboxPath = os.path.normpath(os.path.expanduser('~') + '/Dropbox')
	else:
		dropboxPathSetting = open(os.path.normpath(configurationDirectory+'/dropbox-path'), 'r')
		dropboxPath = dropboxPathSetting.read()
		dropboxPathSetting.close()
	return dropboxPath

def getAccountUID():
	try:
		open(os.path.normpath(configurationDirectory+'/dropbox-id'), 'r')
	except:
		print(' ! Account UID unknown. Public links won\'t work. Run configuration utility')
		dropboxUID = 0
	else:
		dropboxUIDSetting = open(os.path.normpath(configurationDirectory+'/dropbox-id'), 'r')
		dropboxUID = dropboxUIDSetting.read()
		dropboxUIDSetting.close()
	return dropboxUID

def getNotifier():
	try:
		open(os.path.normpath(configurationDirectory+'/notify-settings'), 'r')
	except:
		print(' ! Notifier not specified. Run configuration utility')
		notifier = ''
	else:
		notifierSetting = open(os.path.normpath(configurationDirectory+'/notify-settings'), 'r')
		notifier = notifierSetting.read()
		notifierSetting.close()
	return notifier

dropboxPath = getDropboxPath()
accountUID = getAccountUID()
notifier = getNotifier()

delta_switch = 0
{'fraction_non_alphanumeric': 0.20833333333333334, 'fraction_numerical': 0.007716049382716049, 'mean_word_length': 6.083333333333333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '1522445', 'n_tokens_mistral': 1645, 'n_tokens_neox': 1558, 'n_words': 359}