launch_webbrowser.py revision 77d65c763568495a6ffc7c15a81964448139f47a
77d65c763568495a6ffc7c15a81964448139f47apjrm#!/usr/bin/env python
77d65c763568495a6ffc7c15a81964448139f47apjrmimport webbrowser, threading
77d65c763568495a6ffc7c15a81964448139f47apjrmfrom optparse import OptionParser
77d65c763568495a6ffc7c15a81964448139f47apjrm
77d65c763568495a6ffc7c15a81964448139f47apjrmclass VisitWebSiteWithoutLockingInkscape(threading.Thread):
77d65c763568495a6ffc7c15a81964448139f47apjrm def __init__(self):
77d65c763568495a6ffc7c15a81964448139f47apjrm threading.Thread.__init__ (self)
77d65c763568495a6ffc7c15a81964448139f47apjrm parser = OptionParser()
77d65c763568495a6ffc7c15a81964448139f47apjrm parser.add_option("-u", "--url", action="store", type="string",
77d65c763568495a6ffc7c15a81964448139f47apjrm default="http://www.inkscape.org/",
77d65c763568495a6ffc7c15a81964448139f47apjrm dest="url", help="The URL to open in web browser")
77d65c763568495a6ffc7c15a81964448139f47apjrm (self.options, args) = parser.parse_args()
77d65c763568495a6ffc7c15a81964448139f47apjrm
77d65c763568495a6ffc7c15a81964448139f47apjrm def run(self):
77d65c763568495a6ffc7c15a81964448139f47apjrm webbrowser.open(self.options.url)
77d65c763568495a6ffc7c15a81964448139f47apjrm
77d65c763568495a6ffc7c15a81964448139f47apjrmvwswli = VisitWebSiteWithoutLockingInkscape()
77d65c763568495a6ffc7c15a81964448139f47apjrmvwswli.start()
77d65c763568495a6ffc7c15a81964448139f47apjrm
77d65c763568495a6ffc7c15a81964448139f47apjrm
77d65c763568495a6ffc7c15a81964448139f47apjrm# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 encoding=utf-8 textwidth=99