Back to index

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

List of all members.

Public Member Functions

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

Controller for the KDE File Manager (kfm, or Konqueror).

See the output of ``kfmclient --commands``
for more information on the Konqueror remote-control interface.

Definition at line 327 of file webbrowser.py.


Member Function Documentation

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

Reimplemented from webbrowser.BaseBrowser.

Definition at line 334 of file webbrowser.py.

00334 
00335     def open(self, url, new=0, autoraise=True):
00336         # XXX Currently I know no way to prevent KFM from opening a new win.
00337         if new == 2:
00338             action = "newTab"
00339         else:
00340             action = "openURL"
00341 
00342         devnull = io.open(os.devnull, "r+")
00343         # if possible, put browser in separate process group, so
00344         # keyboard interrupts don't affect browser as well as Python
00345         setsid = getattr(os, 'setsid', None)
00346         if not setsid:
00347             setsid = getattr(os, 'setpgrp', None)
00348 
00349         try:
00350             p = subprocess.Popen(["kfmclient", action, url],
00351                                  close_fds=True, stdin=devnull,
00352                                  stdout=devnull, stderr=devnull)
00353         except OSError:
00354             # fall through to next variant
00355             pass
00356         else:
00357             p.wait()
00358             # kfmclient's return code unfortunately has no meaning as it seems
00359             return True
00360 
00361         try:
00362             p = subprocess.Popen(["konqueror", "--silent", url],
00363                                  close_fds=True, stdin=devnull,
00364                                  stdout=devnull, stderr=devnull,
00365                                  preexec_fn=setsid)
00366         except OSError:
00367             # fall through to next variant
00368             pass
00369         else:
00370             if p.poll() is None:
00371                 # Should be running now.
00372                 return True
00373 
00374         try:
00375             p = subprocess.Popen(["kfm", "-d", url],
00376                                  close_fds=True, stdin=devnull,
00377                                  stdout=devnull, stderr=devnull,
00378                                  preexec_fn=setsid)
00379         except OSError:
00380             return False
00381         else:
00382             return (p.poll() is None)
00383 

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 in webbrowser.MacOSX, and webbrowser.GenericBrowser.

Definition at line 145 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: