chanjunkai 5 år sedan
förälder
incheckning
2a2dd9137d
1 ändrade filer med 6 tillägg och 6 borttagningar
  1. 6 6
      controller/index.py

+ 6 - 6
controller/index.py

@@ -436,22 +436,22 @@ 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)
-    time2=datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
-
     print('command=>{command}'.format(command=command))
     try:
         back = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE). \
             communicate(timeout=10)
-        print("时间:%s"%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)
     else:
         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 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})
 
 
 #测试是否正常接口