Skip to content

Commit

Permalink
Update resolver.py
Browse files Browse the repository at this point in the history
  • Loading branch information
marwin1991 authored Dec 19, 2023
1 parent 177aed0 commit 89a7177
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion valhalla/common/resolver.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
from valhalla.common.logger import info, error

VERSION = "not_set"
VALHALLA_TOKEN = "not_set"


def init_str_resolver(version: str):
def init_str_resolver(version: str, token: str):
global VERSION
global VALHALLA_TOKEN
VERSION = version
VALHALLA_TOKEN = token


def resolve(string: str):
global VERSION
global VALHALLA_TOKEN

if VERSION == "not_set":
error("There was no init_str_resolver(...) call in the code, so resolving strings does not work!")
error("There is bug in valhalla! Please report it here: https://github.com/logchange/valhalla/issues")
exit(1)

string = string.replace("{VERSION}", VERSION)
string = string.replace("{VALHALLA_TOKEN}", VALHALLA_TOKEN)


info("String resolving output: " + string)
return string

0 comments on commit 89a7177

Please sign in to comment.