How to use the mappyfile.tokens.COMPOSITE_NAMES function in mappyfile

To help you get started, we’ve selected a few mappyfile 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 geographika / mappyfile / misc / docs_parser.py View on Github external
for k, v in mapfile_dict.items():
        for kwd, params in v.items():
            keywords.append(kwd)
            for p in params:
                parameters.append(p)

    mappyfile_keywords = COMPOSITE_NAMES.union(ATTRIBUTE_NAMES).union(SINGLETON_COMPOSITE_NAMES)
    docs_keywords = composite_names + keywords + parameters

    for p in sorted(set(parameters)):
        print(p)

    functions = set(spatial_functions + string_functions + arithmetic_functions + geotransform_functions)

    print("Missing from mappyfile:")
    mappyfile_composites = set(COMPOSITE_NAMES.union(SINGLETON_COMPOSITE_NAMES))
    print(sorted(list(set(docs_keywords) - mappyfile_composites - functions)))

    print("Missing from docs:")
    missing = sorted(list(set(mappyfile_keywords) - set(docs_keywords) - functions - missing_list - missing_deprecated))
    print(missing)
github geographika / mappyfile / mappyfile / pprint.py View on Github external
def _format(self, composite, level=0):

        lines = []
        type_ = None

        # get any comments associated with the composite
        comments = composite.get("__comments__", {})

        if isinstance(composite, dict) and '__type__' in composite:
            type_ = composite['__type__']
            assert type_ in COMPOSITE_NAMES.union(SINGLETON_COMPOSITE_NAMES)
            is_hidden = False
            self._add_type_comment(level, comments, lines)
            s = self.whitespace(level, 0) + type_.upper()
            lines.append(s)

        for attr, value in composite.items():
            if self.__is_metadata(attr):
                # skip hidden attributes
                continue
            elif self.is_hidden_container(attr, value):
                # now recursively print all the items in the container
                for v in value:
                    lines += self._format(v, level + 1)
            elif attr == "pattern":
                lines += self.format_pair_list(attr, value, level)
            elif attr in ("metadata", "validation", "values", "connectionoptions"):
github geographika / mappyfile / misc / docs_parser.py View on Github external
read_doc(fn, kwds)

    #pprint.pprint(mapfile_dict)

    composite_names = mapfile_dict.keys()
    keywords = []
    parameters = []

    for k, v in mapfile_dict.items():
        for kwd, params in v.items():
            keywords.append(kwd)
            for p in params:
                parameters.append(p)

    mappyfile_keywords = COMPOSITE_NAMES.union(ATTRIBUTE_NAMES).union(SINGLETON_COMPOSITE_NAMES)
    docs_keywords = composite_names + keywords + parameters

    for p in sorted(set(parameters)):
        print(p)

    functions = set(spatial_functions + string_functions + arithmetic_functions + geotransform_functions)

    print("Missing from mappyfile:")
    mappyfile_composites = set(COMPOSITE_NAMES.union(SINGLETON_COMPOSITE_NAMES))
    print(sorted(list(set(docs_keywords) - mappyfile_composites - functions)))

    print("Missing from docs:")
    missing = sorted(list(set(mappyfile_keywords) - set(docs_keywords) - functions - missing_list - missing_deprecated))
    print(missing)