(rules, current_version=VERSION)
return rules_version == current_version
Check if the given udev rules are up to date.

    :param str rules: The content of an udev rule file to check.
    :param str current_version: The current rivalcfg version.

    :rtype: bool
Check if the given udev rules are up to date.
Check if the given udev rules are up to date .
def are_rules_up_to_date(rules, current_version=VERSION):
    """Check if the given udev rules are up to date.

    :param str rules: The content of an udev rule file to check.
    :param str current_version: The current rivalcfg version.

    :rtype: bool
    """
    version_regexp = re.compile(r".*rivalcfg\s+v([0-9]+\.[0-9]+\.[0-9]+(.+)?)\s*.*")
    rules_version = None
    if version_regexp.match(rules):
        rules_version = version_regexp.match(rules).group(1)
    return rules_version == current_version
def are_rules_up_to_date ( rules , current_version = VERSION ) : version_regexp = re . compile ( r".*rivalcfg\s+v([0-9]+\.[0-9]+\.[0-9]+(.+)?)\s*.*" ) rules_version = None if version_regexp . match ( rules ) : rules_version = version_regexp . match ( rules ) . group ( 1 ) return rules_version == current_version