9.2. fixedlocation

9.2.1. Classes

FixedLocation

Spoof getting a geolocation for a server by provinding a fixed lat, lon

9.2.2. Module Contents

class fixedlocation.FixedLocation

Bases: GeoHealthCheck.geocoder.Geocoder

Spoof getting a geolocation for a server by provinding a fixed lat, lon result. The lat, lon can be specified in the initialisation parameters. When omitted: default to 0, 0.

NAME = 'Fixed geolocation'

Short name of Plugin. TODO: i18n e.g. NAME_nl_NL ?

DESCRIPTION = 'Geolocator service returning a fixed position (so actually no real geolocation).'

Longer description of Plugin. TODO: optional i18n e.g. DESCRIPTION_de_DE ?

LATITUDE = 0

Parameter with the default latitude position. This is overruled when the latitude option is provided in the init step.

LONGITUDE = 0

Parameter with the default longitude position. This is overruled when the longitude option is provided in the init step.

_lat = 0
_lon = 0
init(geocode_vars={})

Initialise the geocoder service with an optional dictionary.

When the dictionary contains the element lat and/or lon, then these values are used to position the server.

locate(_=None)

Perform a geocoding to locate a server. In this case it will render a fixed position, so provinding the adress of the server is optional.