def main(): try: opts, args = getopt.gnu_getopt(sys.argv[1:], "hq", ["help", "quiet"]) except getopt.GetoptError as e: usage(e) verbose = True for opt, val in opts: if opt in ('-h', '--help'): usage() if opt in ('-q', '--quiet'): verbose = False if args: usage() if not registry.sub_apikey and registry.fqdn: fatal("not initialized") try: hubdns = HubDNS(subkey=registry.sub_apikey) ipaddress = hubdns.update(registry.fqdn) except HubDNS.Error as e: fatal(e.description) if verbose: print("Updated %s with %s" % (registry.fqdn, ipaddress))
opts, args = getopt.gnu_getopt(sys.argv[1:], "hq", ["help", "quiet"]) except getopt.GetoptError, e: usage(e) verbose = True for opt, val in opts: if opt in ('-h', '--help'): usage() if opt in ('-q', '--quiet'): verbose = False if args: usage() if not registry.sub_apikey and registry.fqdn: fatal("not initialized") try: hubdns = HubDNS(subkey=registry.sub_apikey) ipaddress = hubdns.update(registry.fqdn) upnp() except HubAPIError, e: fatal(e.description) if verbose: print "Updated %s with %s" % (registry.fqdn, ipaddress) if __name__=="__main__": main()
try: opts, args = getopt.gnu_getopt(sys.argv[1:], "hq", ["help", "quiet"]) except getopt.GetoptError, e: usage(e) verbose = True for opt, val in opts: if opt in ('-h', '--help'): usage() if opt in ('-q', '--quiet'): verbose = False if args: usage() if not registry.sub_apikey and registry.fqdn: fatal("not initialized") try: hubdns = HubDNS(subkey=registry.sub_apikey) ipaddress = hubdns.update(registry.fqdn) except HubDNS.Error, e: fatal(e.description) if verbose: print "Updated %s with %s" % (registry.fqdn, ipaddress) if __name__=="__main__": main()