How to use the hotdoc.extensions.gi_extension.Annotation function in hotdoc

To help you get started, we’ve selected a few hotdoc 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 hotdoc / hotdoc / hotdoc / extensions / gi_extension.py View on Github external
def __make_transfer_annotation(self, annotation, value):
        if value[0] == "none":
            return Annotation ("transfer: none", TRANSFER_NONE_HELP)
        elif value[0] == "full":
            return Annotation ("transfer: full", TRANSFER_FULL_HELP)
        elif value[0] == "floating":
            return Annotation ("transfer: floating", TRANSFER_FLOATING_HELP)
        elif value[0] == "container":
            return Annotation ("transfer: container", TRANSFER_CONTAINER_HELP)
        else:
            return None
github hotdoc / hotdoc / hotdoc / extensions / gi_extension.py View on Github external
def __make_nullable_annotation (self, annotation, value):
        return Annotation("nullable", NULLABLE_HELP)
github hotdoc / hotdoc / hotdoc / extensions / gi_extension.py View on Github external
def __make_array_annotation (self, annotation, value):
        annotation_val = None
        if type(value) == dict:
            annotation_val = ""
            for name, val in value.iteritems():
                annotation_val += "%s=%s" % (name, val)
        return Annotation ("array", ARRAY_HELP, annotation_val)
github hotdoc / hotdoc / hotdoc / extensions / gi_extension.py View on Github external
def __make_closure_annotation (self, annotation, value):
        if type (value) != list or not value:
            return Annotation ("closure", CLOSURE_DATA_HELP)

        return Annotation ("closure", CLOSURE_HELP % value[0])
github hotdoc / hotdoc / hotdoc / extensions / gi_extension.py View on Github external
def __make_out_annotation (self, annotation, value):
        return Annotation ("out", DIRECTION_OUT_HELP)
github hotdoc / hotdoc / hotdoc / extensions / gi_extension.py View on Github external
def __make_type_annotation (self, annotation, value):
        if not value:
            return None

        return Annotation("type", TYPE_HELP, value[0])
github hotdoc / hotdoc / hotdoc / extensions / gi_extension.py View on Github external
def __make_scope_annotation (self, annotation, value):
        if type (value) != list or not value:
            return None

        if value[0] == "async":
            return Annotation ("scope async", SCOPE_ASYNC_HELP)
        elif value[0] == "call":
            return Annotation ("scope call", SCOPE_CALL_HELP)
        elif value[0] == 'notified':
            return Annotation ("scope notified", SCOPE_NOTIFIED_HELP)
        return None
github hotdoc / hotdoc / hotdoc / extensions / gi_extension.py View on Github external
def __make_optional_annotation (self, annotation, value):
        return Annotation ("optional", OPTIONAL_HELP)
github hotdoc / hotdoc / hotdoc / extensions / gi_extension.py View on Github external
def __make_scope_annotation (self, annotation, value):
        if type (value) != list or not value:
            return None

        if value[0] == "async":
            return Annotation ("scope async", SCOPE_ASYNC_HELP)
        elif value[0] == "call":
            return Annotation ("scope call", SCOPE_CALL_HELP)
        elif value[0] == 'notified':
            return Annotation ("scope notified", SCOPE_NOTIFIED_HELP)
        return None
github hotdoc / hotdoc / hotdoc / extensions / gi_extension.py View on Github external
def __make_scope_annotation (self, annotation, value):
        if type (value) != list or not value:
            return None

        if value[0] == "async":
            return Annotation ("scope async", SCOPE_ASYNC_HELP)
        elif value[0] == "call":
            return Annotation ("scope call", SCOPE_CALL_HELP)
        elif value[0] == 'notified':
            return Annotation ("scope notified", SCOPE_NOTIFIED_HELP)
        return None