How to use the pyfrc.config function in pyfrc

To help you get started, we’ve selected a few pyfrc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github robotpy / robotpy-wpilib-utilities / robotpy_ext / autonomous / selector_tests.py View on Github external
import pyfrc.config
import pytest
from networktables.util import ChooserControl

autonomous_seconds = 15
_gsms = pyfrc.config.config_obj["pyfrc"]["game_specific_messages"]


@pytest.mark.parametrize("gamedata", _gsms or [""])
def test_all_autonomous(control, fake_time, robot, gamedata):
    """
        This test runs all possible autonomous modes that can be selected
        by the autonomous switcher.
        
        This should work for most robots. If it doesn't work for yours, 
        and it's not a code issue with your robot, please file a bug on
        github.
    """

    class AutonomousTester:
        def __init__(self):
            self.initialized = False
github robotpy / pyfrc / docs / conf.py View on Github external
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

#
# Imports
#

import sys
import os
from os.path import abspath, dirname

# Project must be built+installed to generate docs
import pyfrc
import pyfrc.config

pyfrc.config.config_obj["pyfrc"] = dict(game_specific_messages=[])

# -- RTD configuration ------------------------------------------------

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

# This is used for linking and such so we link to the thing we're building
rtd_version = os.environ.get("READTHEDOCS_VERSION", "latest")
if rtd_version not in ["stable", "latest"]:
    rtd_version = "stable"

# -- General configuration ------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.