popen -> run
This commit is contained in:
parent
ab311c54d8
commit
ee4a6865d8
@ -1,5 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import run
|
||||||
from sys import stderr
|
from sys import stderr
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from time import time, sleep
|
from time import time, sleep
|
||||||
@ -342,16 +342,14 @@ class DBStorage(PushStorage):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def pushsubscription(subscription: dict):
|
def pushsubscription(subscription: dict):
|
||||||
p = Popen(["node", "v25pushx/push.js"], stdin=PIPE, shell=True)
|
assert run(["node", "v25pushx/push.js"], input=json.dumps({
|
||||||
p.communicate(json.dumps({
|
|
||||||
"subscription": subscription,
|
"subscription": subscription,
|
||||||
"notification": {
|
"notification": {
|
||||||
"notification": {
|
"notification": {
|
||||||
"title": "New Message (V25PUSH)"
|
"title": "New Message (V25PUSH)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).encode())
|
})).returncode, "push subprocess failed"
|
||||||
assert not p.wait(), "push subprocess failed"
|
|
||||||
|
|
||||||
def pushpush(self, subject: Subject):
|
def pushpush(self, subject: Subject):
|
||||||
session = self.Session()
|
session = self.Session()
|
||||||
|
Loading…
Reference in New Issue
Block a user