def _get_props()

in tools/resource.py [0:0]


    def _get_props(self, read_only=False):
        properties = self.schema["Properties"]
        read_only_properties = self.schema.get("ReadOnlyProperties")
        if read_only_properties:
            read_only_names = set(
                n.replace("/properties/", "") for n in read_only_properties
            )
        else:
            read_only_names = set()

        if read_only:
            props = {n: properties[n] for n in properties if n in read_only_names}
        else:
            props = {n: properties[n] for n in properties if n not in read_only_names}
        return props