Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #9
0
 def open(self, url, new=0, autoraise=1):
     ic.launchurl(url)
     return True  # Any way to get status?
Пример #10
0
 def open(self, url, new=0, autoraise=1):
     ic.launchurl(url)
     return True # Any way to get status?
Пример #11
0
 def open(self, url, new=0):
     ic.launchurl(url)
Пример #12
0
 def open(self, url, new=0):
     ic.launchurl(url)