|
@@ -436,13 +436,13 @@ def testRunStream(request):
|
|
|
UID=request_dict.get('UID', None)
|
|
|
PWD=request_dict.get('PWD', None)
|
|
|
MSG=request_dict.get('MSG', None)
|
|
|
- # time1=datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
|
|
|
+ time1=datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
|
|
|
command = "./pushtool {UID} {PWD} {MSG} 1".format(UID=UID, PWD=PWD, MSG=MSG)
|
|
|
print('command=>{command}'.format(command=command))
|
|
|
try:
|
|
|
back = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE). \
|
|
|
communicate(timeout=10)
|
|
|
- # time2=datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
|
|
|
+ time2=datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
|
|
|
# print("时间:%s"%datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
|
|
|
except Exception as e:
|
|
|
return repr(e)
|
|
@@ -450,8 +450,8 @@ def testRunStream(request):
|
|
|
print("back0----", back[0].decode()) # 注意需要进行解码操作,默认输出的是字节
|
|
|
print("back1----", back[1].decode()) # back是一个元祖,可以通过元祖取值的方式获取结果
|
|
|
#return str(back[0].decode()) + str(back[1].decode())
|
|
|
- #return JsonResponse({'msg': "star is %s"%time1+",end is %s"%time2, 'code': 0})
|
|
|
- return JsonResponse({'msg': "run stream", 'code': 0})
|
|
|
+ return JsonResponse({'msg': "star is %s"%time1+",end is %s"%time2, 'code': 0})
|
|
|
+ # return JsonResponse({'msg': "run stream", 'code': 0})
|
|
|
|
|
|
|
|
|
#测试是否正常接口
|