本文整理汇总了Python中helpers.queryhelper.QueryHelper.get_version_info_by_category方法的典型用法代码示例。如果您正苦于以下问题:Python QueryHelper.get_version_info_by_category方法的具体用法?Python QueryHelper.get_version_info_by_category怎么用?Python QueryHelper.get_version_info_by_category使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers.queryhelper.QueryHelper
的用法示例。
在下文中一共展示了QueryHelper.get_version_info_by_category方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from helpers.queryhelper import QueryHelper [as 别名]
# 或者: from helpers.queryhelper.QueryHelper import get_version_info_by_category [as 别名]
def get(self):
category = int(self.get_argument('category', 2))
if category == 2: # ydws
#version_info = get_version_info('android')
download_info = get_download_count(category, self.db)
version_info = QueryHelper.get_version_info_by_category(
UWEB.APK_TYPE.YDWS, self.db)
update_download_count(category, self.db)
self.render('android_weixin.html',
versioncode=version_info.versioncode,
versionname=version_info.versionname,
versioninfo=version_info.versioninfo,
updatetime=version_info.updatetime,
filesize=version_info.filesize,
count=download_info.count)
elif category == 3: # ydwq_monitor
version_info = QueryHelper.get_version_info_by_category(
UWEB.APK_TYPE.YDWQ_MONITOR, self.db)
url = "/static/apk/" + version_info['filename']
self.redirect(url)
elif category == 4: # ydwq_monitored
version_info = QueryHelper.get_version_info_by_category(
UWEB.APK_TYPE.YDWQ_MONITORED, self.db)
url = "/static/apk/" + version_info['filename']
self.redirect(url)
elif category == 5: # ydws_anjietong
version_info = QueryHelper.get_version_info_by_category(
UWEB.APK_TYPE.YDWS_ANJIETONG, self.db)
url = "/static/apk/" + version_info['filename']
self.redirect(url)
示例2: get
# 需要导入模块: from helpers.queryhelper import QueryHelper [as 别名]
# 或者: from helpers.queryhelper.QueryHelper import get_version_info_by_category [as 别名]
def get(self):
status = ErrorCode.SUCCESS
try:
category = int(self.get_argument('category', UWEB.APK_TYPE.YDWS))
if category == UWEB.APK_TYPE.YDWS: # 1
#version_info = get_version_info("android")
version_info = QueryHelper.get_version_info_by_category(
category, self.db)
elif category == UWEB.APK_TYPE.YDWQ_MONITOR: # 2
version_info = QueryHelper.get_version_info_by_category(
category, self.db)
elif category == UWEB.APK_TYPE.YDWQ_MONITORED: # 3
version_info = QueryHelper.get_version_info_by_category(
category, self.db)
elif category == UWEB.APK_TYPE.YDWS_ANJIETONG: # 4
version_info = QueryHelper.get_version_info_by_category(
category, self.db)
else:
logging.info("[UWEB] Invalid category: %s",
category)
self.write_ret(status,
dict_=DotDict(version_info=version_info))
except Exception as e:
logging.exception(
"[UWEB] Android check update failed. Exception: %s", e.args)
status = ErrorCode.SERVER_BUSY
self.write_ret(status)
示例3: get
# 需要导入模块: from helpers.queryhelper import QueryHelper [as 别名]
# 或者: from helpers.queryhelper.QueryHelper import get_version_info_by_category [as 别名]
def get(self):
"""Jump to android.html."""
category = self.get_argument('category', '2')
#version_info = get_version_info('android')
version_info = QueryHelper.get_version_info_by_category(
UWEB.APK_TYPE.YDWS, self.db)
download_info = get_download_count(category, self.db)
self.render('android.html',
versioncode=version_info.versioncode,
versionname=version_info.versionname,
versioninfo=version_info.versioninfo,
updatetime=version_info.updatetime,
filesize=version_info.filesize,
count=download_info.count if download_info else 0)