dataaccess.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:n1mm_view 作者: n1kdo 项目源码 文件源码
def get_last_qso(cursor) :
    cursor.execute('SELECT timestamp, callsign, exchange, section, operator.name, band_id \n'
                   'FROM qso_log JOIN operator WHERE operator.id = operator_id \n'
                   'ORDER BY timestamp DESC LIMIT 1')
    last_qso_time = int(time.time()) - 60
    message = ''
    for row in cursor:
        last_qso_time = row[0]
    message = 'Last QSO: %s %s %s on %s by %s at %s' % (
        row[1], row[2], row[3], constants.Bands.BANDS_TITLE[row[5]], row[4],
        datetime.utcfromtimestamp(row[0]).strftime('%H:%M:%S'))
    logging.debug(message)
    return last_qso_time, message
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号