<commit_before>﻿using System;
using System.Net;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace WakaTime
{
    internal static class WakaTimeConstants
    {        
        internal const string CliUrl = "https://github.com/wakatime/wakatime/archive/master.zip";
        internal const string PluginName = "visualstudio-wakatime";
        internal const string EditorName = "visualstudio";
        internal const string CliFolder = @"wakatime-master\wakatime\cli.py";
        internal static string UserConfigDir = Application.UserAppDataPath;
        internal static Func<string> CurrentWakaTimeCliVersion = () =>
        {
            var regex = new Regex(@"(__version_info__ = )(\(( ?\'[0-9]\'\,?){3}\))");
            var client = new WebClient();
            var about = client.DownloadString("https://raw.githubusercontent.com/wakatime/wakatime/master/wakatime/__about__.py");
            var match = regex.Match(about);

            if (!match.Success)
            {
                Logger.Warning("Couldn't auto resolve wakatime cli version");
                return string.Empty;                
            }

            var grp1 = match.Groups[2];
            var regexVersion = new Regex("([0-9])");
            var match2 = regexVersion.Matches(grp1.Value);

            return string.Format("{0}.{1}.{2}", match2[0].Value, match2[1].Value, match2[2].Value);
        };

    }
}<commit_msg>Changed wakatime-master folder to user's directory<commit_after>﻿using System;
using System.Net;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace WakaTime
{
    internal static class WakaTimeConstants
    {        
        internal const string CliUrl = "https://github.com/wakatime/wakatime/archive/master.zip";
        internal const string PluginName = "visualstudio-wakatime";
        internal const string EditorName = "visualstudio";
        internal const string CliFolder = @"wakatime-master\wakatime\cli.py";
        internal static string UserConfigDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
        internal static Func<string> CurrentWakaTimeCliVersion = () =>
        {
            var regex = new Regex(@"(__version_info__ = )(\(( ?\'[0-9]\'\,?){3}\))");
            var client = new WebClient();
            var about = client.DownloadString("https://raw.githubusercontent.com/wakatime/wakatime/master/wakatime/__about__.py");
            var match = regex.Match(about);

            if (!match.Success)
            {
                Logger.Warning("Couldn't auto resolve wakatime cli version");
                return string.Empty;                
            }

            var grp1 = match.Groups[2];
            var regexVersion = new Regex("([0-9])");
            var match2 = regexVersion.Matches(grp1.Value);

            return string.Format("{0}.{1}.{2}", match2[0].Value, match2[1].Value, match2[2].Value);
        };

    }
}
{'fraction_non_alphanumeric': 0.1257647858599592, 'fraction_numerical': 0.012236573759347382, 'mean_word_length': 2.418118466898955, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6095545', 'n_tokens_mistral': 868, 'n_tokens_neox': 835, 'n_words': 171}