Exemplo n.º 1
0
def openurl(url):
  try:
    webbrowser.open(url)
  except ImportError: # pre-webbrowser.py compatibility
    if sys.platform == 'win32':
      os.system('start "%s"' % url)
    elif sys.platform == 'mac':
      try: import ic
      except ImportError: pass
      else: ic.launchurl(url)
    else:
      rc = os.system('google-chrome -remote "openURL(%s)" &' % url)
      if rc: os.system('google-chrome "%s" &' % url)
Exemplo n.º 2
0
 def open_browser(self, url):
     try:
         import webbrowser
         webbrowser.open(url)
     except ImportError: # pre-webbrowser.py compatibility
         if sys.platform == 'win32':
             os.system('start "%s"' % url)
         elif sys.platform == 'mac':
             try: import ic
             except ImportError: pass
             else: ic.launchurl(url)
         else:
             rc = os.system('netscape -remote "openURL(%s)" &' % url)
             if rc: os.system('netscape "%s" &' % url)
Exemplo n.º 3
0
 def start_browser():
     if sys.platform == 'darwin':
         # use Mac OS X internet config module (removed in Python 3.0)
         import ic
         ic.launchurl(url)
     else:
         try:
             import gconf
             client = gconf.client_get_default()
             browser = client.get_string(
                     '/desktop/gnome/url-handlers/http/command') + '&'
             os.system(browser % url)
         except ImportError:
             # If gconf is not found, fall back to old standard
             os.system('firefox ' + url)
Exemplo n.º 4
0
 def start_browser():
     if sys.platform == 'darwin':
         # use Mac OS X internet config module (removed in Python 3.0)
         import ic
         ic.launchurl(url)
     else:
         try:
             import mateconf
             client = mateconf.client_get_default()
             browser = client.get_string(
                 '/desktop/mate/url-handlers/http/command') + '&'
             os.system(browser % url)
         except ImportError:
             # If mateconf is not found, fall back to old standard
             os.system('firefox ' + url)
Exemplo n.º 5
0
        def start_browser():
            if sys.platform == "darwin":
                # use Mac OS X internet config module (removed in Python 3.0)
                import ic

                ic.launchurl(url)
            else:
                try:
                    import mateconf

                    client = mateconf.client_get_default()
                    browser = client.get_string("/desktop/mate/url-handlers/http/command") + "&"
                    os.system(browser % url)
                except ImportError:
                    # If mateconf is not found, fall back to old standard
                    os.system("firefox " + url)
Exemplo n.º 6
0
 def open(self, event=None, url=None):
     """opens a browser window on the local machine"""
     url = url or self.server.url
     try:
         import webbrowser
         webbrowser.open(url)
     except ImportError: # pre-webbrowser.py compatibility
         if sys.platform == 'win32':
             os.system('start "%s"' % url)
         elif sys.platform == 'mac':
             try:
                 import ic
                 ic.launchurl(url)
             except ImportError: pass
         else:
             rc = os.system('netscape -remote "openURL(%s)" &' % url)
             if rc: os.system('netscape "%s" &' % url)
Exemplo n.º 7
0
 def open(self, event=None, url=None):
     """opens a browser window on the local machine"""
     url = url or self.server.url
     try:
         import webbrowser
         webbrowser.open(url)
     except ImportError:  # pre-webbrowser.py compatibility
         if sys.platform == 'win32':
             os.system('start "%s"' % url)
         elif sys.platform == 'mac':
             try:
                 import ic
                 ic.launchurl(url)
             except ImportError:
                 pass
         else:
             rc = os.system('netscape -remote "openURL(%s)" &' % url)
             if rc: os.system('netscape "%s" &' % url)
Exemplo n.º 8
0
def doInfo(event,GUIobj):
    """ open the browser at the given url
    """
    import webbrowser

    url = system.url
    try:
        webbrowser.open(url)
    except ImportError: # pre-webbrowser.py compatibility
        import sys
        import os
        if sys.platform == 'win32':
            os.system('start "%s"' % url)
        elif sys.platform == 'mac':
            try: import ic
            except ImportError: pass
            else: ic.launchurl(url)
        else:
            rc = os.system('netscape -remote "openURL(%s)" &' % url)
            if rc: os.system('netscape "%s" &' % url)
Exemplo n.º 9
0
 def open(self, url, new=0, autoraise=1):
     ic.launchurl(url)
     return True  # Any way to get status?
Exemplo n.º 10
0
 def open(self, url, new=0, autoraise=1):
     ic.launchurl(url)
     return True # Any way to get status?
Exemplo n.º 11
0
 def open(self, url, new=0):
     ic.launchurl(url)
Exemplo n.º 12
0
 def open(self, url, new=0):
     ic.launchurl(url)