From b87e8dd5a8bbc3385375ade01ef3090ef09152d7 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Mon, 18 Dec 2017 16:41:11 +0200 Subject: [PATCH] Initial work for issue #47 . Define a custom deal index. --- pysollib/pysolrandom.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pysollib/pysolrandom.py b/pysollib/pysolrandom.py index 4911a357..2bc54c21 100644 --- a/pysollib/pysolrandom.py +++ b/pysollib/pysolrandom.py @@ -287,9 +287,12 @@ def constructRandom(s): MS_LONG_BIT = (long(1) << 1000) +CUSTOM_BIT = (long(1) << 999) def random__str2long(s): + if s == 'Custom': + return CUSTOM_BIT | MS_LONG_BIT m = _match_ms(s) if m: return (long(m.group(1)) | MS_LONG_BIT) @@ -299,6 +302,8 @@ def random__str2long(s): def random__long2str(l): if ((l & MS_LONG_BIT) != 0): + if ((l & CUSTOM_BIT) != 0): + return 'Custom' return "ms" + str(l & (~ MS_LONG_BIT)) else: return str(l)