| 1234567891011121314151617181920212223242526272829303132333435 |
- # -*- coding: utf-8 -*-
- from app.visa_free_config_fetchers.base_fetcher import BaseFetcher
- CITY_MAP = {
- "bjs": "Beijing",
- "sha": "Shanghai",
- "dub": "Dublin",
- "tok": "Tokio",
- "tyo": "Tokio"
- }
- class POLFetcher(BaseFetcher):
- def __init__(self):
- super(POLFetcher, self).__init__("pol")
- def fetch_free_config(self, origin, target, visa_type, vac_code=None):
- origin_clean = origin.lower().strip()
- target_clean = target.lower().strip()
- vac_clean = (vac_code or "").lower().strip()
- missions = self.metadata.get("missions", {})
- mission_key = "{}_{}".format(origin_clean, target_clean)
- if vac_clean and "{}_{}_{}".format(origin_clean, vac_clean, target_clean) in missions:
- mission_key = "{}_{}_{}".format(origin_clean, vac_clean, target_clean)
- mission_data = missions.get(mission_key, {})
- if not mission_data:
- location = CITY_MAP.get(vac_clean, vac_clean.capitalize() if vac_clean else "")
- mission_data = {
- "query_url": "https://secure.e-konsulat.gov.pl",
- "service_type": "Wiza Schengen",
- "location": location
- }
- return mission_data
|