9.2. fixedlocation

9.2.1. Module Contents

9.2.1.1. Classes

FixedLocation

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

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'
DESCRIPTION = 'Geolocator service returning a fixed position (so actually no real geolocation).'
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.

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.