From 2efcb93d437561bd08384ad554132fd99b4866c5 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Sun, 11 Sep 2022 09:54:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8=E7=BA=BF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BB=A3=E7=A0=81=E5=9B=A0gitee=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E5=86=85=E9=83=A8=E6=97=B6=E5=8C=BA=E4=B8=8E=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E4=B8=8D=E4=B8=80=E8=87=B4=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto_pt/views.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/auto_pt/views.py b/auto_pt/views.py index 7c24bc2..075f283 100644 --- a/auto_pt/views.py +++ b/auto_pt/views.py @@ -1,6 +1,7 @@ import json import socket import subprocess +import sys from datetime import datetime, timedelta import docker @@ -78,22 +79,8 @@ def test_notify(request): def do_sql(request): - with open('./cookies.json', 'r') as f: - # print(f.readlines()) - datas = json.load(f) - cookies = [] - for data in datas: - domain = data.get('url') - cookie_list = data.get('cookies') - cookie_str = '' - for cookie in cookie_list: - cookie_str += cookie.get('name') + '=' + cookie.get('value') + ';' - print(domain, cookie_str) - cookies.append({ - 'domain': domain, - 'cookies': cookie_str.rstrip(';') - }) - print(len(cookies)) + print('exit') + sys.exit(3) return JsonResponse('ok', safe=False) @@ -165,7 +152,7 @@ def get_git_logs(master='', n=10): info = {} list1 = string.split(':', 1) # 格式化时间 - update_time = datetime.strptime(list1[1].strip(), '%a %b %d %X %Y +0800') + update_time = datetime.strptime(list1[1].strip(), '%a %b %d %H:%M:%S %Y %z') info['date'] = update_time.strftime('%Y-%m-%d %H:%M:%S') info['data'] = [] continue @@ -209,6 +196,7 @@ def update_page(request): local_time = utc_time + timedelta(hours=8) delta = str((datetime.now() - local_time).seconds) + '秒' print(delta) + # delta = '666' # delta = local_time.strftime('%Y-%m-%dT%H:%M:%S.%f') # delta = delta.astimezone(pytz.timezone('Asia/Shanghai')) except Exception as e: