django_socio_grpc.management.commands.generateproto

Module Contents

Classes

Command

Functions

_get_resource_file_name

Obtain the filename for a resource on the file system.

API

django_socio_grpc.management.commands.generateproto._get_resource_file_name(package_or_requirement: str, resource_name: str) str

Obtain the filename for a resource on the file system.

class django_socio_grpc.management.commands.generateproto.Command(stdout=None, stderr=None, no_color=False, force_color=False)

Bases: django.core.management.base.BaseCommand

help

‘Generates proto.’

add_arguments(parser)
handle(*args, **options)
check_or_write(file: pathlib.Path, proto, app_name)

Write the new generated proto to the corresponding file If option –check is used verify if the new content is identical to one already there

check_proto_generation(original_file, new_proto_content, app_name)

If option –check activated allow to verify that the new generated content is identical to the content of the actual file If not raise a ProtobufGenerationException