()
Run some checks on Linux.
Run some checks on Linux.
Run some checks on Linux .
def _check_linux():
    """Run some checks on Linux."""

    # Only run checks on Linux
    if platform.system() != "Linux":
        return

    # Skip check for root as there will be no issue for this user
    if os.getuid() == 0:
        return

    # Skip check if user is trying to update udev rules:
    if "--update-udev" in sys.argv:
        return

    if not os.path.isfile(udev.RULES_FILE_PATH):
        sys.stderr.write(
            "W: udev rules are not installed. You may not be able to open the device using a regular user.\n"
        )
        sys.stderr.write("   Run 'rivalcfg --update-udev' as root to fix.\n\n")
    elif not udev.is_rules_file_up_to_date():
        sys.stderr.write(
            "W: Installed udev rules were generated by an other rivalcfg version.\n"
        )
        sys.stderr.write("   Run 'rivalcfg --update-udev' as root to update.\n\n")
def _check_linux ( ) : # Only run checks on Linux if platform . system ( ) != "Linux" : return # Skip check for root as there will be no issue for this user if os . getuid ( ) == 0 : return # Skip check if user is trying to update udev rules: if "--update-udev" in sys . argv : return if not os . path . isfile ( udev . RULES_FILE_PATH ) : sys . stderr . write ( "W: udev rules are not installed. You may not be able to open the device using a regular user.\n" ) sys . stderr . write ( "   Run 'rivalcfg --update-udev' as root to fix.\n\n" ) elif not udev . is_rules_file_up_to_date ( ) : sys . stderr . write ( "W: Installed udev rules were generated by an other rivalcfg version.\n" ) sys . stderr . write ( "   Run 'rivalcfg --update-udev' as root to update.\n\n" )