mirror of
https://github.com/SqrtMinusOne/biome.git
synced 2025-12-10 14:35:13 +03:00
biome-query: add override-column-names
This commit is contained in:
parent
e1ab97b773
commit
fc52a2b7ac
1 changed files with 10 additions and 3 deletions
|
|
@ -73,6 +73,12 @@ The format is: (name latitude longitude)."
|
||||||
(number :tag "Longitude")))
|
(number :tag "Longitude")))
|
||||||
:group 'biome)
|
:group 'biome)
|
||||||
|
|
||||||
|
(defcustom biome-query-override-column-names nil
|
||||||
|
"Override column names for variables."
|
||||||
|
:type '(repeat (cons
|
||||||
|
(string :tag "Variable name")
|
||||||
|
(string :tag "Column name"))))
|
||||||
|
|
||||||
(defconst biome-query-groups '("daily" "hourly" "minutely_15" "hourly")
|
(defconst biome-query-groups '("daily" "hourly" "minutely_15" "hourly")
|
||||||
"Name of groups.
|
"Name of groups.
|
||||||
|
|
||||||
|
|
@ -163,9 +169,10 @@ disambiguations of parameters in `biome-api-data'."
|
||||||
|
|
||||||
KEY is the api key of the variable. VAR-NAMES is the output of
|
KEY is the api key of the variable. VAR-NAMES is the output of
|
||||||
`biome-query--get-var-names-cache'."
|
`biome-query--get-var-names-cache'."
|
||||||
(gethash key var-names
|
(or (cdr (assoc key biome-query-override-column-names))
|
||||||
(capitalize (replace-regexp-in-string
|
(gethash key var-names)
|
||||||
(regexp-quote "_") " " key))))
|
(capitalize (replace-regexp-in-string
|
||||||
|
(regexp-quote "_") " " key))))
|
||||||
|
|
||||||
(cl-defmethod transient-format ((_obj biome-query--transient-report))
|
(cl-defmethod transient-format ((_obj biome-query--transient-report))
|
||||||
"Format the `biome-query-current'."
|
"Format the `biome-query-current'."
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue