Browse Source

bin/tau-python: sleep a bit for modifications to reflect before showing the modified task

Dastan-glitch 2 years ago
parent
commit
06c22f2b80
1 changed files with 3 additions and 1 deletions
  1. 3 1
      bin/tau/tau-python/main.py

+ 3 - 1
bin/tau/tau-python/main.py

@@ -1,6 +1,7 @@
 #!/usr/bin/python3
 import asyncio, json, os, sys, tempfile
 from datetime import datetime
+import time
 from tabulate import tabulate
 from colorama import Fore, Back, Style
 
@@ -532,7 +533,7 @@ Example:
     try:
         id = int(sys.argv[1])
         refid = data[id]
-    except ValueError:
+    except (ValueError, KeyError):
         print("error: invalid ID", file=sys.stderr)
         return -1
 
@@ -546,6 +547,7 @@ Example:
     if subcmd == "modify":
         if (errc := await modify_task(refid, args)) < 0:
             return errc
+        time.sleep(0.1)
         return await show_task(refid)
     elif subcmd in ["start", "pause", "stop", "cancel"]:
         status = subcmd