Browse Source

Work around for race condition ://

atexit
Raphael Roberts 6 years ago
parent
commit
ca5f6224c2
  1. 4
      .gitignore
  2. 1
      MANIFEST.in
  3. 4
      ctabus/internal/echo_if_exists.sh
  4. 12
      ctabus/internal/notification.py
  5. 1
      setup.py

4
.gitignore

@ -13,4 +13,6 @@ sensitive.py
/ctabus_venv/*
.venv
*.json
.dir-locals.el
.dir-locals.el
/build
/dist

1
MANIFEST.in

@ -0,0 +1 @@
include ctabus/internal/echo_if_exists.sh

4
ctabus/internal/echo_if_exists.sh

@ -0,0 +1,4 @@
#!/system/xbin/ash
if [ -e $2 ]; then
echo -n $1 > $2
fi

12
ctabus/internal/notification.py

@ -1,5 +1,6 @@
from concurrent.futures import ThreadPoolExecutor
import os
import shlex
import shutil
import subprocess
import uuid
@ -79,7 +80,16 @@ class NotificationManager:
"--priority",
"high",
"--on-delete",
"echo {} > {}".format(self.id, self.listen_fifo_path),
"{} {} {}".format(
*map(
shlex.quote,
(
os.path.join(os.path.dirname(__file__), "echo_if_exists.sh"),
self.id,
self.listen_fifo_path,
),
)
),
]
message = self.message if self.message is not None else "Placeholder"

1
setup.py

@ -11,6 +11,7 @@ setup(
author="rlbr",
author_email="raphael.roberts48@gmail.com",
packages=find_packages(),
include_package_data=True,
entry_points={"console_scripts": ["ctabus=ctabus.__main__:main"]},
classifiers=[
"License :: OSI Approved :: MIT License",

Loading…
Cancel
Save