# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1265456337 -3600 # Node ID 475b1a88664536d4634d499e838de70fc86b9353 # Parent e627607e24d0081c3abc661b8215e9cde9083878 open the web browser when doing the web thingy. diff -r e627607e24d0 -r 475b1a886645 review/extension_ui.py --- a/review/extension_ui.py Sat Feb 06 06:39:15 2010 -0500 +++ b/review/extension_ui.py Sat Feb 06 12:38:57 2010 +0100 @@ -15,7 +15,7 @@ ui.note(messages.WEB_START) import web_ui - web_ui.load_interface(ui, repo) + web_ui.load_interface(ui, repo, open=True) def _init_command(ui, repo, **opts): ui.note(messages.INIT_START) diff -r e627607e24d0 -r 475b1a886645 review/web_ui.py --- a/review/web_ui.py Sat Feb 06 06:39:15 2010 -0500 +++ b/review/web_ui.py Sat Feb 06 12:38:57 2010 +0100 @@ -113,10 +113,15 @@ return content -def load_interface(ui, repo): +def load_interface(ui, repo, open=False): global _rd _rd = api.ReviewDatastore(ui, repo) sys.argv = sys.argv[:1] # Seriously, web.py? This is such a hack. app = web.application(urls, globals()) + + if open: + import webbrowser + webbrowser.open(app.browser().url) + app.run()