Skip to content

Commit e17c038

Browse files
committed
ui
1 parent 52d3447 commit e17c038

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

ServerApp/AppVersion/AppVersion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ def GetAppVersion():
6868
if __name__ == '__main__':
6969
# app.run()
7070

71-
# 8182 8183
71+
# 8182
7272
app.run(host='0.0.0.0', port=8182)

ServerApp/AppVersion/AppVersionTest.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
# 在Ubuntu上安装Chrome浏览器和ChromeDriver
2222
# https://www.cnblogs.com/z-x-y/p/9024622.html
23+
# google-chrome --version
2324

2425
# http://127.0.0.1:8080/
2526
# http://47.242.56.146:8080/
@@ -41,17 +42,19 @@ def GetAppVersionHuawei():
4142
# return "2.0.0"
4243
return mainAppVersionParser.GetVersion(cur_version,package,appid)
4344

44-
# http://mooncore.cn:8183/AppVersion_taptap?cur_version=1.2.0&package=com.moonma.hanziyuan&appid=46445
45+
# http://mooncore.cn:8182/AppVersion_taptap?cur_version=1.2.0&package=com.moonma.hanziyuan&appid=46445
4546
# http://0.0.0.0:8182/AppVersion_taptap?cur_version=1.2.0&package=com.moonma.hanziyuan&appid=46445
47+
# // http://mooncore.cn:8182/AppVersion_taptap?cur_version=1.0.5&package=com.moonma.ladderclimb&appid=216810
48+
# // http://127.0.0.1:8182/AppVersion_taptap?cur_version=1.0.5&package=com.moonma.ladderclimb&appid=216810
4649
@app.route('/AppVersion_taptap')
47-
def GetServerAppVersionTapTap():
50+
def GetAppVersionTapTap():
4851
print(request.url)
4952
cur_version = request.args["cur_version"]
5053
package = request.args["package"]
5154
appid = request.args["appid"]
5255
print(appid)
5356
# return "2.0.0"
54-
return mainServerAppVersionTapTap.GetVersion(cur_version,package,appid)
57+
return mainServerAppVersionTapTap.GetVersion(cur_version,package,appid,True)
5558

5659
# http://mooncore.cn:8080/AppVersion?package=com.moonma.caicaile
5760
@app.route('/AppVersion')
@@ -64,4 +67,6 @@ def GetAppVersion():
6467

6568
if __name__ == '__main__':
6669
# app.run()
70+
71+
#
6772
app.run(host='0.0.0.0', port=8183)

ServerApp/AppVersion/ServerAppVersionTapTap.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ def GetVersion(self,html, start,min,end):
3939
def GetHtml(self,appid):
4040
url = "https://www.taptap.com/app/" + appid
4141
# 创建chrome浏览器驱动,无头模式(超爽)
42-
chrome_options = Options()
42+
chrome_options = Options()
43+
chrome_options.add_argument('--headless')
44+
4345
# linux 上chrome上需要加上下面两句 ,不然会报错
44-
# 例如 unknown error: DevToolsActivePort file doesn‘t exist
46+
# 例如 unknown error: DevToolsActivePort file doesn‘t exist
4547
chrome_options.add_argument('--headless')
4648
chrome_options.add_argument('--no-sandbox')
4749
chrome_options.add_argument('--disable-gpu')
@@ -94,7 +96,7 @@ def ParseVersionFromWeb(self,appid):
9496

9597

9698

97-
def GetVersion(self,cur_version,package,appid):
99+
def GetVersion(self,cur_version,package,appid,isDebug=False):
98100
# print(request.url)
99101
# appinfo = AppInfo()
100102
# appinfo.appid= "100270155"
@@ -106,7 +108,14 @@ def GetVersion(self,cur_version,package,appid):
106108

107109
version = db.GetVersionByPackage(package)
108110
print(" dbversion = ",version)
111+
isByWeb = False
109112
if version<cur_version:
113+
isByWeb = True
114+
115+
if isDebug:
116+
isByWeb =True
117+
118+
if isByWeb:
110119
version = self.ParseVersionFromWeb(appid)
111120
appinfo = AppInfo()
112121
appinfo.appid= appid

0 commit comments

Comments
 (0)