From fd61da0faec28dfda0408f98ddede3553f738e95 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" <david.chassin@me.com> Date: Thu, 16 Jan 2025 09:41:28 -0600 Subject: [PATCH] Update Location.md --- docs/Tools/Location.md | 89 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 85 insertions(+), 4 deletions(-) diff --git a/docs/Tools/Location.md b/docs/Tools/Location.md index 6aad4cb8c..69f60479d 100644 --- a/docs/Tools/Location.md +++ b/docs/Tools/Location.md @@ -6,17 +6,19 @@ Options: * `--debug`: enable debug traceback on exception +* `--find[=KEY[:VALUE][,...]]`: get location settings + +* `--format=FORMAT[,OPTION[:VALUE[,...]]] + * `--quiet`: suppress error messages * `--silent`: suppress all error messages -* `--warning`: suppress warning messages +* `--system[=KEY[:VALUE][,...]]`: get/set the default location * `--verbose`: enable verbose output, if any -* `--system[=LOCATION]`: get/set the default location - -* `--find[=LOCATION]`: get location settings +* `--warning`: suppress warning messages Description: @@ -30,6 +32,10 @@ is stored in `GLD_ETC/location_config.glm The `location` tool `--find` options can identify the current location of a system or a location based on partial information. +Location setting on `FILENAME` will be performed in place, i.e., the file will +first be read and the it will be written with the new values. The result +output to stdout will be the previous values. + The keys and globals handled by the `location` tools include the following: * `latitude`: the location's latitude @@ -68,3 +74,78 @@ Set the location in a model file gridlabd location ieee123.json=country:US,state:CA,county:Kern,city:Bakersfield + +# Functions + +## `find() -> dict` + +Find location data + +Arguments: + +* `kwargs`: Partial location data (see `system()`). None return IP location. + +Returns: + +* Location data + + +--- + +## `get_location() -> None` + +TODO + +--- + +## `main() -> int` + +Main location routine + +Arguments: + +* `argv`: command line argument list + +Returns: + +* Exit code + + +--- + +## `set_location() -> None` + +TODO + +--- + +## `system() -> dict` + +Get/set system location settings + +Arguments: + +* `latitude`: new latitude + +* `longitude`: new longitude + +* `number`: new street number + +* `street`: new street name + +* `zipcode`: new zipcode + +* `city`: new city + +* `county`: new county + +* `state`: new state + +* `region`: new region + +* `country`: new country + +Returns: + +* previous location settings +