def load_rc_file():
    """
    Load the contents of the resource file ~/.uDMXrc
    """
    # If an rc file is named in the config, use it.
    # Otherwise, fall back to looking in the HOME directory.
    # The fall back won't work under RPi because HOME will be root.
    if "uDMXrc" in config:
        rcfile = config["uDMXrc"]
    else:
        if os.name == "nt":
            # Windows
            rcfile = os.path.join(os.environ["USERPROFILE"], ".uDMXrc")
        else:
            # Mostly *nix type systems
            rcfile = os.path.join(os.environ["HOME"], ".uDMXrc")
    try:
        cf = open(rcfile, 'r')
        for line in cf:
            tokens = line.split()

            # Blank line
            if len(tokens) == 0:
                continue

            # A comment
            if tokens[0] == '#':
                continue
            # A channel alias
            elif tokens[0] == 'channel':
                # channel alias value
                if len(tokens) >= 3:
                    if is_valid_channel(tokens[2]):
                        add_channel(tokens[1], tokens[2])
                    else:
                        print(line)
                        print("Invalid channel value")
                else:
                    print(line)
                    print("Invalid channel statement")
            # A DMX value or values
            elif tokens[0] in ['value', 'values']:
                # value alias value
                if len(tokens) >= 3:
                    if are_valid_values(tokens[2:]):
                        add_values(tokens[1], tokens[2:])
                    else:
                        print(line)
                        print("Invalid value(s)")
                else:
                    print(line)
                    print("Invalid value statement")
            # Something we don't recognize
            else:
                print(line)
                print(tokens[0], "is not a recognized resource file statement")
        cf.close()
    except:
        print("Unable to open resource file", rcfile)
Load the contents of the resource file ~/.uDMXrc