示例#1
0
from eea.climateadapt.vocabulary import KeywordsVocabulary
from eea.climateadapt.vocabulary import generic_vocabulary
from zope.interface import alsoProvides
from zope.schema.interfaces import IVocabularyFactory


SearchTypesVocabularyFactory = KeywordsVocabulary('search_type')
ElementsVocabularyFactory = KeywordsVocabulary('elements')

_regions = ['Adriatic-Ionian', 'Alpine Space', 'Northern Periphery and Arctic',
           'Atlantic', 'Balkan-Mediterranean', 'Baltic Sea',
           'Central Europe', 'Danube', 'Mediterranean', 'North Sea',
           'North West Europe', 'South West Europe', 'Other regions']
regions_vocabulary = generic_vocabulary(_regions)
alsoProvides(regions_vocabulary, IVocabularyFactory)
示例#2
0
from zope.interface import alsoProvides
from zope.schema.interfaces import IVocabularyFactory

from eea.climateadapt.vocabulary import (KeywordsVocabulary,
                                         generic_vocabulary, labels)

SearchTypesVocabularyFactory = KeywordsVocabulary('search_type')
ElementsVocabularyFactory = KeywordsVocabulary('elements')

_regions = [
    'Adriatic-Ionian', 'Alpine Space', 'Atlantic', 'Balkan-Mediterranean',
    'Baltic Sea', 'Central Europe', 'Danube', 'Mediterranean', 'North Sea',
    'North West Europe', 'Northern Periphery and Arctic', 'South West Europe',
    'Other regions'
]

regions_vocabulary = generic_vocabulary(_regions)
alsoProvides(regions_vocabulary, IVocabularyFactory)

BIOREGIONS = {}

for line in filter(None, labels.split('\n')):
    if 'TRANS_BIO' not in line:
        continue
    first, label = line.split('=')
    name = first.split('-lbl-')[1]
    BIOREGIONS[name] = label

bioregions_vocab_factory = generic_vocabulary(BIOREGIONS)
alsoProvides(bioregions_vocab_factory, IVocabularyFactory)
示例#3
0
from eea.climateadapt.vocabulary import generic_vocabulary
from zope.interface import alsoProvides
from zope.schema.interfaces import IVocabularyFactory


_climateimpacts = [
    ("FORESTFIRES", "Forest Fires"),
    ("EXTREMETEMP", "Extreme Temperatures"),
    ("WATERSCARCE", "Water Scarcity"),
    ("FLOODING", "Flooding"),
    ("SEALEVELRISE", "Sea Level Rise"),
    ("DROUGHT", "Droughts"),
    ("STORM", "Storms"),
    ("ICEANDSNOW", "Ice and Snow"),
]
cityprofile_climateimpacts_vocabulary = generic_vocabulary(_climateimpacts)
alsoProvides(cityprofile_climateimpacts_vocabulary, IVocabularyFactory)

_sectors = [    # this is the canonical
    ("AGRICULTURE", "Agriculture and Forest"),
    ("BIODIVERSITY", "Biodiversity"),
    ("COASTAL", "Coastal areas"),
    ("DISASTERRISKREDUCTION", "Disaster Risk Reduction"),
    ("FINANCIAL", "Financial"),
    ("HEALTH", "Health"),
    # ("INFRASTRUCTURE", "Infrastructure"),
    ("URBAN", "Urban"),
    ("MARINE", "Marine and Fisheries"),
    ("TOURISM", "Tourism"),
    ("ENERGY", "Energy"),
    ("TRANSPORT", "Transport"),