Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up the hacks in pywps #3

Open
agstephens opened this issue Jun 5, 2024 · 0 comments
Open

Tidy up the hacks in pywps #3

agstephens opened this issue Jun 5, 2024 · 0 comments
Assignees

Comments

@agstephens
Copy link
Owner

from collections import namedtuple
from pywps import FORMATS, Format

#_FORMATS = namedtuple('FORMATS', 'GEOJSON, JSON, SHP')
#FORMATS = _FORMATS(
#    Format('application/geo+json', extension='.geojson'),
#    Format('application/json', extension='.json'),
#    Format('application/x-zipped-shp', extension='.zip', encoding='base64'),
#)

new_formats = [
    ("DOG", Format('application/json', extension='.dog')),
    ("CAT", Format('application/json', extension='.cat'))
]
_FORMATS_EXT = namedtuple('FORMATS_EXT', _FORMATS._fields + tuple(fmt[0] for fmt in new_formats))
all_formats = [fmt_spec for _, fmt_spec in FORMATS._asdict().items()] + [fmt[1] for fmt in new_formats]

FORMATS_EXT = _FORMATS_EXT(*all_formats)
print(FORMATS_EXT._fields)
@agstephens agstephens self-assigned this Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant