当前位置: 首页>>代码示例>>Python>>正文


Python QueryHelper.get_tmobile_by_tid方法代码示例

本文整理汇总了Python中helpers.queryhelper.QueryHelper.get_tmobile_by_tid方法的典型用法代码示例。如果您正苦于以下问题:Python QueryHelper.get_tmobile_by_tid方法的具体用法?Python QueryHelper.get_tmobile_by_tid怎么用?Python QueryHelper.get_tmobile_by_tid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在helpers.queryhelper.QueryHelper的用法示例。


在下文中一共展示了QueryHelper.get_tmobile_by_tid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: issue_cellid

# 需要导入模块: from helpers.queryhelper import QueryHelper [as 别名]
# 或者: from helpers.queryhelper.QueryHelper import get_tmobile_by_tid [as 别名]
def issue_cellid(location, db, redis):
    logging.info("[LBMPHELPER] %s Issue cellid...", location.dev_id)
    location.gps = 0
    location.type = 1
    location.degree = random.randint(0, 360)
    # 1: get latlon through cellid
    cellid_info = [int(item) for item in location.cellid.split(":")]
    #NOTE: Check version of terminal: If version if 2.3.x, do not issue cellid
    terminal = db.get("SELECT id, tid, mobile, softversion FROM T_TERMINAL_INFO WHERE tid = %s", location.dev_id)
    if terminal and str(terminal['softversion'][0:3]) == '2.3':
        logging.info("[LBMPHELPER] %s softversion: %s is 2.3.x, do not issue cellid", location.dev_id, terminal['softversion'])
        location.lat, location.lon = 0, 0
    elif terminal and str(terminal['softversion'][0:5]) == '2.6.3':
        logging.info("[LBMPHELPER] %s softversion: %s is 2.6.3, do not issue cellid", location.dev_id, terminal['softversion'])
        location.lat, location.lon = 0, 0
    else:
        sim = QueryHelper.get_tmobile_by_tid(location.dev_id, redis, db)
        location.lat, location.lon = get_latlon_from_cellid(cellid_info[0],cellid_info[1],cellid_info[2],cellid_info[3], sim)

    logging.info("[LBMPHELPER] %s cellid result, lat:%s, lon:%s", location.dev_id, location.lat, location.lon)

    return location
开发者ID:jcsy521,项目名称:ydws,代码行数:24,代码来源:lbmphelper.py


注:本文中的helpers.queryhelper.QueryHelper.get_tmobile_by_tid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。