<commit_before>"""
This module is about refreshing Rainmeter from within Sublime Text.

This can be either activated via a command or as part of the build system.
"""


import os.path

import sublime
import sublime_plugin
from . import rainmeter
from .path.program_path_provider import get_cached_program_path


def calculate_refresh_commands(rm_exe, config, fil, activate, is_inc):
    if activate:
        cmds = [rm_exe, "!ActivateConfig", config]
        if not is_inc:
            cmds.append(fil)
        return cmds
    else:
        return None


class RainmeterRefreshConfigCommand(sublime_plugin.ApplicationCommand):
    """Refresh a given skin file, or Rainmeter if no path is specified."""

    def run(self, cmd):  # pylint: disable=R0201; sublime text API, no need for class reference
        """Called when the command is run."""
        # Get Rainmeter exe path
        rm_path = get_cached_program_path()
<commit_msg>Added docstrings<commit_after>"""
This module is about refreshing Rainmeter from within Sublime Text.

This can be either activated via a command or as part of the build system.
"""


import os.path

import sublime
import sublime_plugin
from . import rainmeter
from .path.program_path_provider import get_cached_program_path


def calculate_refresh_commands(rm_exe, config, fil, activate, is_inc):
    """Detect if an activate config flag is required or not."""
    if activate:
        cmds = [rm_exe, "!ActivateConfig", config]
        if not is_inc:
            cmds.append(fil)
        return cmds
    else:
        return None


class RainmeterRefreshConfigCommand(sublime_plugin.ApplicationCommand):
    """Refresh a given skin file, or Rainmeter if no path is specified."""

    def run(self, cmd):  # pylint: disable=R0201; sublime text API, no need for class reference
        """Called when the command is run."""
        # Get Rainmeter exe path
        rm_path = get_cached_program_path()

{'fraction_non_alphanumeric': 0.07390180878552971, 'fraction_numerical': 0.004134366925064599, 'mean_word_length': 3.4505747126436783, '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': '188268', 'n_tokens_mistral': 576, 'n_tokens_neox': 540, 'n_words': 209}