()
return rules
Generates the content of the udev rules file.

    :rtype: str
Generates the content of the udev rules file.
Generates the content of the udev rules file .
def generate_rules():
    """Generates the content of the udev rules file.

    :rtype: str
    """
    rules = "# Generated by rivalcfg v%s\n" % VERSION
    rules += (
        "# Do not edit this file. It can be regenerated with the following command:\n"
    )
    rules += "# \n"
    rules += "#     rivalcfg --update-udev\n\n"

    for profile in PROFILES.values():
        rules += "# %s\n" % profile["name"]
        rules += (
            'SUBSYSTEM=="hidraw", ATTRS{idVendor}=="%04x", ATTRS{idProduct}=="%04x", MODE="0666"\n'
            % (profile["vendor_id"], profile["product_id"])
        )
        rules += (
            'SUBSYSTEM=="usb", ATTRS{idVendor}=="%04x", ATTRS{idProduct}=="%04x", MODE="0666"\n\n'
            % (profile["vendor_id"], profile["product_id"])
        )

    return rules
def generate_rules ( ) : rules = "# Generated by rivalcfg v%s\n" % VERSION rules += ( "# Do not edit this file. It can be regenerated with the following command:\n" ) rules += "# \n" rules += "#     rivalcfg --update-udev\n\n" for profile in PROFILES . values ( ) : rules += "# %s\n" % profile [ "name" ] rules += ( 'SUBSYSTEM=="hidraw", ATTRS{idVendor}=="%04x", ATTRS{idProduct}=="%04x", MODE="0666"\n' % ( profile [ "vendor_id" ] , profile [ "product_id" ] ) ) rules += ( 'SUBSYSTEM=="usb", ATTRS{idVendor}=="%04x", ATTRS{idProduct}=="%04x", MODE="0666"\n\n' % ( profile [ "vendor_id" ] , profile [ "product_id" ] ) ) return rules