<commit_before>#!/usr/bin/python

import urllib2
import re
import datetime
import subprocess
import os
import json
from argparse import ArgumentParser

# TODO -- [no-nag] tag
# TODO -- take out non-tracked appovals from the queries (ie: approval-mozilla-aurora+ but not tracked)

CONFIG_JSON = os.getcwd() + "/scripts/configs/config.json"
config = json.load(open(CONFIG_JSON, 'r'))
scripts_dir =  os.getcwd() + "/scripts/"
queries_dir =  os.getcwd() + "/queries/"

def getTemplateValue(url):
	version_regex = re.compile(".*<p>(.*)</p>.*")
	template_page = urllib2.urlopen(url).read().replace('\n', '')
	parsed_template = version_regex.match(template_page)
	return parsed_template.groups()[0]

def getReportURL(approval_flag, span):
	a = urllib2.urlopen("https://bugzilla.mozilla.org/page.cgi?id=release_tracking_report.html&q=" + approval_flag + "%3A%2B%3A" + span + "%3A0%3Aand%3A")
	return a.url
    
no_nag = ";field3-1-0=status_whiteboard;type3-1-0=notsubstring;value3-1-0=[no-nag]"
beta_version =		getTemplateValue("https://wiki.mozilla.org/Template:BETA_VERSION")
aurora_version =	getTemplateValue("https://wiki.mozilla.org/Template:AURORA_VERSION")
central_version =	getTemplateValue("https://wiki.mozilla.org/Template:CENTRAL_VERSION")
esr_version =		getTemplateValue("https://wiki.mozilla.org/Template:ESR_VERSION")<commit_msg>cleanup todo list<commit_after>#!/usr/bin/python

import urllib2
import re
import datetime
import subprocess
import os
import json
from argparse import ArgumentParser

CONFIG_JSON = os.getcwd() + "/scripts/configs/config.json"
config = json.load(open(CONFIG_JSON, 'r'))
scripts_dir =  os.getcwd() + "/scripts/"
queries_dir =  os.getcwd() + "/queries/"

def getTemplateValue(url):
	version_regex = re.compile(".*<p>(.*)</p>.*")
	template_page = urllib2.urlopen(url).read().replace('\n', '')
	parsed_template = version_regex.match(template_page)
	return parsed_template.groups()[0]

def getReportURL(approval_flag, span):
	a = urllib2.urlopen("https://bugzilla.mozilla.org/page.cgi?id=release_tracking_report.html&q=" + approval_flag + "%3A%2B%3A" + span + "%3A0%3Aand%3A")
	return a.url
    
no_nag = ";field3-1-0=status_whiteboard;type3-1-0=notsubstring;value3-1-0=[no-nag]"
beta_version =		getTemplateValue("https://wiki.mozilla.org/Template:BETA_VERSION")
aurora_version =	getTemplateValue("https://wiki.mozilla.org/Template:AURORA_VERSION")
central_version =	getTemplateValue("https://wiki.mozilla.org/Template:CENTRAL_VERSION")
esr_version =		getTemplateValue("https://wiki.mozilla.org/Template:ESR_VERSION")
{'fraction_non_alphanumeric': 0.16012558869701726, 'fraction_numerical': 0.015698587127158554, 'mean_word_length': 6.200564971751413, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 10, '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': '7357680', 'n_tokens_mistral': 943, 'n_tokens_neox': 922, 'n_words': 137}