From cdb1dad534e9a8f505c4c5c2b5a9ed3fa86380b3 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Fri, 7 Jul 2023 16:02:45 +0200 Subject: [PATCH] Little hack to cast str to int for rand seed --- slate/slate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slate/slate.py b/slate/slate.py index e5ae6d9..a29e7a7 100644 --- a/slate/slate.py +++ b/slate/slate.py @@ -83,6 +83,8 @@ class Slate(): def expand_vars(self, string, **kwargs): if isinstance(string, str): + if string == '{rand}': + return int(random.random()*99999999) return string.format(**kwargs, rand=int(random.random()*99999999)) return string