diff options
author | lassulus <lass@blue.r> | 2018-09-18 16:13:55 +0200 |
---|---|---|
committer | lassulus <lass@blue.r> | 2018-09-18 16:13:55 +0200 |
commit | 6e2a93f9aba19a96038f858132b09607eb2f4619 (patch) | |
tree | c86299777c9688b5c51edfadd8c44da6e354e9a2 /krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py | |
parent | 245994cc7ace5a323c476ccc50fd4026b9353dc4 (diff) |
Reaktor sed-plugin: add until open shelve file
Diffstat (limited to 'krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py')
-rw-r--r-- | krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py b/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py index 51ac7a071..ecb03917b 100644 --- a/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py +++ b/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py @@ -8,9 +8,19 @@ import shelve from os import environ from os.path import join from sys import argv +from time import sleep import re -d = shelve.open(join(environ['state_dir'], 'sed-plugin.shelve'), writeback=True) +# try to open the shelve file until it succeeds +while True: + try: + d = shelve.open( + join(environ['state_dir'], 'sed-plugin.shelve'), + writeback=True + ) + break + except: # noqa: E722 + sleep(0.2) usr = environ['_from'] |