How to use the osrsbox.prayers_api.prayer_properties.PrayerProperties function in osrsbox

To help you get started, we’ve selected a few osrsbox 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 osrsbox / osrsbox-db / osrsbox / prayers_api / all_prayers.py View on Github external
def _load_prayer(self, prayer_json: Dict) -> None:
        """Convert the `prayer_json` into a :class:`PrayerProperties` and store it.

        :param prayer_json: A dict from an open and loaded JSON file.
        :raises ValueError: Cannot populate prayer.
        """
        # Load the prayer using the PrayerProperties class
        try:
            prayer_def = PrayerProperties.from_json(prayer_json)
        except TypeError as e:
            raise ValueError("Error: Invalid JSON structure found, check supplied input. Exiting") from e

        # Add prayer to list
        self.all_prayers.append(prayer_def)
        self.all_prayers_dict[prayer_def.id] = prayer_def