Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
webbrowser.MacOSX Class Reference
Inheritance diagram for webbrowser.MacOSX:
Inheritance graph
[legend]
Collaboration diagram for webbrowser.MacOSX:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def open
def open_new
def open_new_tab

Public Attributes

 name
 basename
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Public Attributes

list args = ['%s']

Detailed Description

Launcher class for Aqua browsers on Mac OS X

Optionally specify a browser name on instantiation.  Note that this
will not work for Aqua browsers if the user has moved the application
package after installation.

If no browser is specified, the default browser, as specified in the
Internet System Preferences panel, will be used.

Definition at line 535 of file webbrowser.py.


Constructor & Destructor Documentation

def webbrowser.MacOSX.__init__ (   self,
  name 
)

Reimplemented from webbrowser.BaseBrowser.

Definition at line 545 of file webbrowser.py.

00545 
00546         def __init__(self, name):
00547             self.name = name

Here is the caller graph for this function:


Member Function Documentation

def webbrowser.MacOSX.open (   self,
  url,
  new = 0,
  autoraise = True 
)

Reimplemented from webbrowser.BaseBrowser.

Definition at line 548 of file webbrowser.py.

00548 
00549         def open(self, url, new=0, autoraise=True):
00550             assert "'" not in url
00551             # hack for local urls
00552             if not ':' in url:
00553                 url = 'file:'+url
00554 
00555             # new must be 0 or 1
00556             new = int(bool(new))
00557             if self.name == "default":
00558                 # User called open, open_new or get without a browser parameter
00559                 script = 'open location "%s"' % url.replace('"', '%22') # opens in default browser
00560             else:
00561                 # User called get and chose a browser
00562                 if self.name == "OmniWeb":
00563                     toWindow = ""
00564                 else:
00565                     # Include toWindow parameter of OpenURL command for browsers
00566                     # that support it.  0 == new window; -1 == existing
00567                     toWindow = "toWindow %d" % (new - 1)
00568                 cmd = 'OpenURL "%s"' % url.replace('"', '%22')
00569                 script = '''tell application "%s"
00570                                 activate
00571                                 %s %s
00572                             end tell''' % (self.name, cmd, toWindow)
00573             # Open pipe to AppleScript through osascript command
00574             osapipe = os.popen("osascript", "w")
00575             if osapipe is None:
00576                 return False
00577             # Write script to osascript's stdin
00578             osapipe.write(script)
00579             rc = osapipe.close()
00580             return not rc
00581 
    class MacOSXOSAScript(BaseBrowser):

Here is the call graph for this function:

def webbrowser.BaseBrowser.open_new (   self,
  url 
) [inherited]

Definition at line 151 of file webbrowser.py.

00151 
00152     def open_new(self, url):
00153         return self.open(url, 1)

Here is the call graph for this function:

def webbrowser.BaseBrowser.open_new_tab (   self,
  url 
) [inherited]

Definition at line 154 of file webbrowser.py.

00154 
00155     def open_new_tab(self, url):
00156         return self.open(url, 2)
00157 

Here is the call graph for this function:


Member Data Documentation

list webbrowser.BaseBrowser.args = ['%s'] [static, inherited]

Reimplemented in webbrowser.GenericBrowser.

Definition at line 142 of file webbrowser.py.

Reimplemented in webbrowser.GenericBrowser.

Definition at line 146 of file webbrowser.py.

Reimplemented from webbrowser.BaseBrowser.

Definition at line 546 of file webbrowser.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


The documentation for this class was generated from the following file: