[tor-commits] [flashproxy/master] Code uniformity.
dcf at torproject.org
dcf at torproject.org
Sun May 19 05:43:10 UTC 2013
commit d1b3a5f301aec1df333198144d4844225d4916b8
Author: David Fifield <david at bamsoftware.com>
Date: Sat May 18 22:43:01 2013 -0700
Code uniformity.
---
flashproxy-reg-email | 5 ++---
flashproxy-reg-url | 7 ++++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/flashproxy-reg-email b/flashproxy-reg-email
index 5bbf6fa..edfaff1 100755
--- a/flashproxy-reg-email
+++ b/flashproxy-reg-email
@@ -18,7 +18,7 @@ except ImportError:
# Defer the error reporting so that --help works even without M2Crypto.
X509 = None
-DEFAULT_REMOTE_ADDRESS = ""
+DEFAULT_REMOTE_ADDRESS = None
DEFAULT_REMOTE_PORT = 9000
DEFAULT_EMAIL_ADDRESS = "flashproxyreg.a at gmail.com"
# dig MX gmail.com
@@ -185,7 +185,6 @@ def get_facilitator_pubkey():
else:
return RSA.load_pub_key_bio(BIO.MemoryBuffer(DEFAULT_FACILITATOR_PUBKEY_PEM))
-options.remote_addr = (DEFAULT_REMOTE_ADDRESS, DEFAULT_REMOTE_PORT)
options.email_addr = DEFAULT_EMAIL_ADDRESS
options.smtp_addr = (DEFAULT_SMTP_HOST, DEFAULT_SMTP_PORT)
@@ -208,7 +207,7 @@ for o, a in opts:
options.smtp_addr = parse_addr_spec(a, DEFAULT_SMTP_HOST, DEFAULT_SMTP_PORT)
if len(args) == 0:
- pass
+ options.remote_addr = (DEFAULT_REMOTE_ADDRESS, DEFAULT_REMOTE_PORT)
elif len(args) == 1:
options.remote_addr = parse_addr_spec(args[0], DEFAULT_REMOTE_ADDRESS, DEFAULT_REMOTE_PORT)
else:
diff --git a/flashproxy-reg-url b/flashproxy-reg-url
index bdd8cc6..77935e1 100755
--- a/flashproxy-reg-url
+++ b/flashproxy-reg-url
@@ -9,6 +9,7 @@ import urlparse
from M2Crypto import RSA, BIO
+DEFAULT_REMOTE_ADDRESS = None
DEFAULT_REMOTE_PORT = 9000
DEFAULT_FACILITATOR_URL = "https://fp-facilitator.org/"
DEFAULT_FACILITATOR_PUBKEY_PEM = """\
@@ -115,11 +116,11 @@ for o, a in opt:
sys.exit()
if len(args) != 1:
- usage(f=sys.stderr)
+ usage(sys.stderr)
sys.exit(1)
-remote_addr = parse_addr_spec(args[0], defport=DEFAULT_REMOTE_PORT)
-if remote_addr[0] is None:
+remote_addr = parse_addr_spec(args[0], DEFAULT_REMOTE_ADDRESS, DEFAULT_REMOTE_PORT)
+if not remote_addr[0]:
print >> sys.stderr, "An IP address (not just a port) is required."
sys.exit(1)
More information about the tor-commits
mailing list