-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af92f5b
commit 73aca56
Showing
7 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ | |
from . import msgCustomManager | ||
from . import data | ||
from . import webTool | ||
from . import webAPI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# -*- encoding: utf-8 -*- | ||
''' | ||
_______________________ _________________________________________ | ||
__ __ \__ /____ _/_ | / /__ |__ __ \___ _/_ ____/__ ____/ | ||
_ / / /_ / __ / __ | / /__ /| |_ / / /__ / _ / __ __/ | ||
/ /_/ /_ /____/ / __ |/ / _ ___ | /_/ /__/ / / /___ _ /___ | ||
\____/ /_____/___/ _____/ /_/ |_/_____/ /___/ \____/ /_____/ | ||
@File : webAPI.py | ||
@Author : lunzhiPenxil仑质 | ||
@Contact : [email protected] | ||
@License : AGPL | ||
@Copyright : (C) 2020-2021, OlivOS-Team | ||
@Desc : None | ||
''' | ||
|
||
import OlivaDiceCore | ||
import OlivaDiceMaster | ||
|
||
import threading | ||
import time | ||
|
||
def init_getCheckAPI(botDict:dict): | ||
threading.Thread( | ||
target = getCheckAPI, | ||
args = (botDict, ) | ||
).start() | ||
|
||
def getCheckAPI(botDict:dict): | ||
while True: | ||
webRes = None | ||
for botDict_this in botDict: | ||
webRes = None | ||
webRes = OlivaDiceMaster.webTool.GETHttpJson2Dict('http://api.oliva.icu/checkout/?hash=%s' % str(botDict_this)) | ||
if 'code' in webRes and webRes['code'] == 0: | ||
if ( | ||
'data' in webRes | ||
) and ( | ||
'svn' in webRes['data'] | ||
) and ( | ||
type(webRes['data']['svn']) == int | ||
) and ( | ||
webRes['data']['svn'] > OlivaDiceCore.data.OlivaDiceCore_svn | ||
): | ||
if OlivaDiceMaster.data.globalProc != None: | ||
OlivaDiceMaster.data.globalProc.log(3, '检测到新版本: %s' % str(webRes['data']['svn']), [ | ||
('OlivaDice', 'default'), | ||
('init', 'default') | ||
]) | ||
else: | ||
if OlivaDiceMaster.data.globalProc != None: | ||
OlivaDiceMaster.data.globalProc.log(2, '当前已为最新版本' , [ | ||
('OlivaDice', 'default'), | ||
('init', 'default') | ||
]) | ||
time.sleep(1 * 60 * 60) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/ /_/ /_ /____/ / __ |/ / _ ___ | /_/ /__/ / / /___ _ /___ | ||
\____/ /_____/___/ _____/ /_/ |_/_____/ /___/ \____/ /_____/ | ||
@File : msgReply.py | ||
@File : webTool.py | ||
@Author : lunzhiPenxil仑质 | ||
@Contact : [email protected] | ||
@License : AGPL | ||
|