effectiveip.py 文件源码

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

项目:Alfred-Workflow 作者: stidio 项目源码 文件源码
def main(wf):
    # ?????????
    param = (wf.args[0] if len(wf.args) else '').strip()
    if param:
        title, ip = resolve_ip_from_dns(param)
    else:
        title = get_local_ip()
        ip = get_public_ip()

    if ip:
        location = get_location_information(ip)
        wf.add_item(title=title, 
                    subtitle=ip + ' ' + location if location else '', 
                    arg=ip,
                    valid=True,
                    icon=ICON_INFO)
    else:
        wf.add_item(title=title, subtitle='...', icon=ICON_ERROR)

    # Send the results to Alfred as XML
    wf.send_feedback()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号