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


Python PushBullet.pushAddress方法代码示例

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


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

示例1: pushAddress

# 需要导入模块: from pushbullet import PushBullet [as 别名]
# 或者: from pushbullet.PushBullet import pushAddress [as 别名]
def pushAddress(args):
    p = PushBullet(args.api_key)
    address = p.pushAddress(args.device, args.name, " ".join(args.address))
    if args.json:
        print(json.dumps(address))
        return
    print("Address %s sent to %s" % (address["iden"], address["target_device_iden"]))
开发者ID:Mondego,项目名称:pyreco,代码行数:9,代码来源:allPythonContent.py

示例2: pushAddress

# 需要导入模块: from pushbullet import PushBullet [as 别名]
# 或者: from pushbullet.PushBullet import pushAddress [as 别名]
def pushAddress(args):
    p = PushBullet(args.api_key)
    address = p.pushAddress(args.device, args.name, " ".join(args.address))
    if args.json:
        print(json.dumps(address))
        return
    if args.device and args.device[0] == '#':
        print("Address broadcast to channel %s" % (args.device))
    elif not args.device:
        print("Address %s sent to all devices" % (address["iden"]))
    else:
        print("Address %s sent to %s" % (address["iden"], address["target_device_iden"]))
开发者ID:kakai248,项目名称:pyPushBullet,代码行数:14,代码来源:pushbullet_cmd.py

示例3: pushAddress

# 需要导入模块: from pushbullet import PushBullet [as 别名]
# 或者: from pushbullet.PushBullet import pushAddress [as 别名]
def pushAddress(args):
    p = PushBullet(args.api_key)
    try:
        address = p.pushAddress(args.device, args.name, " ".join(args.address))
    except HTTPError:
        _, e, _ = sys.exc_info()
        print("The server couldn\'t fulfill the request.")
        print("Error code: %s" % (e.code))
    except URLError:
        _, e, _ = sys.exc_info()
        print("We failed to reach a server.")
        print("Reason: %s" % (e.reason))
    else:
        if args.json:
            print(address)
            return
        if "created" in address:
            print("OK")
        else:
            print("ERROR %s" % (address))
开发者ID:wimac,项目名称:home,代码行数:22,代码来源:pushbullet_cmd.py


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