[Yt-svn] commit/yt: MatthewTurk: Adding port prompting to the serve command
Bitbucket
commits-noreply at bitbucket.org
Mon May 2 14:40:53 PDT 2011
1 new changeset in yt:
http://bitbucket.org/yt_analysis/yt/changeset/06cbdbd032a1/
changeset: r4231:06cbdbd032a1
branch: yt
user: MatthewTurk
date: 2011-05-02 23:40:45
summary: Adding port prompting to the serve command
affected #: 2 files (280 bytes)
--- a/yt/gui/reason/bottle_mods.py Mon May 02 09:49:51 2011 -0600
+++ b/yt/gui/reason/bottle_mods.py Mon May 02 14:40:45 2011 -0700
@@ -136,10 +136,10 @@
return rv
def uuid_serve_functions(pre_routed = None, open_browser=False, port=9099,
- repl = None):
+ repl = None, token = None):
if pre_routed == None: pre_routed = route_functions
debug(mode=True)
- token = uuid.uuid1()
+ if token is None: token = uuid.uuid1()
for r in pre_routed:
args, kwargs, f = pre_routed[r]
if r[0] == "/": r = r[1:]
--- a/yt/utilities/command_line.py Mon May 02 09:49:51 2011 -0600
+++ b/yt/utilities/command_line.py Mon May 02 14:40:45 2011 -0700
@@ -939,6 +939,13 @@
sock.bind(('', 0))
opts.port = sock.getsockname()[-1]
del sock
+ elif opts.port == '-1':
+ port = raw_input("Desired yt port? ")
+ try:
+ opts.port = int(port)
+ except ValueError:
+ print "Please try a number next time."
+ return 1
base_extjs_path = os.path.join(os.environ["YT_DEST"], "src")
if not os.path.isfile(os.path.join(base_extjs_path, "ext-resources", "ext-all.js")):
print
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list