KDE 4.2 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

Slave Class Reference

from PyKDE4.kio import *

Inherits: KIO.SlaveInterface → QObject
Namespace: KIO

Detailed Description


Signals

 slaveDied (KIO.Slave slave)

Methods

 __init__ (self, QString protocol, QObject parent=0)
 accept (self)
 deref (self)
 gotInput (self)
 hold (self, KUrl url)
QString host (self)
time_t idleTime (self)
bool isAlive (self)
bool isConnected (self)
 kill (self)
QString passwd (self)
int port (self)
QString protocol (self)
 ref (self)
 resetHost (self)
 resume (self)
 send (self, int cmd, QByteArray arr=QByteArray())
 setConfig (self, KIO.MetaData config)
 setConnected (self, bool c)
 setHost (self, QString host, int port, QString user, QString passwd)
 setIdle (self)
 setPID (self, pid_t a0)
 setProtocol (self, QString protocol)
 slaveDied (self, KIO.Slave slave)
QString slaveProtocol (self)
int slave_pid (self)
 suspend (self)
bool suspended (self)
 timeout (self)
QString user (self)

Static Methods

KIO.Slave, int (error) createSlave (QString protocol, KUrl url, QString error_text)
KIO.Slave holdSlave (QString protocol, KUrl url)

Method Documentation

__init__ (  self,
QString  protocol,
QObject  parent=0
)
accept (   self )
KIO.Slave, int (error) createSlave ( QString  protocol,
KUrl  url,
QString  error_text
)

Creates a new slave.

Parameters:
protocol  the protocol
url  is the url
error  is the error code on failure and undefined else.
error_text  is the error text on failure and undefined else.

Returns:
0 on failure, or a pointer to a slave otherwise.

deref (   self )
gotInput (   self )
hold (  self,
KUrl  url
)

Puts the kioslave associated with url at halt, and return it to klauncher, in order to let another application connect to it and finish the job. This is for the krunner case: type a URL in krunner, it will start downloading to find the mimetype (KRun), and then hold the slave, publish the held slave using, this method, and the final application can continue the same download by requesting the same URL.

KIO.Slave holdSlave ( QString  protocol,
KUrl  url
)

Requests a slave on hold for ths url, from klauncher, if there is such a job. See hold()

QString host (   self )

Returns:
Host this slave is (was?) connected to

time_t idleTime (   self )

Returns:
The time this slave has been idle.

bool isAlive (   self )

Returns:
true if the slave survived the last mission.

bool isConnected (   self )
kill (   self )

Force termination

QString passwd (   self )

Returns:
Passwd used to log in

int port (   self )

Returns:
port this slave is (was?) connected to

QString protocol (   self )

The protocol this slave handles.

Returns:
name of protocol handled by this slave, as seen by the user

ref (   self )
resetHost (   self )

Clear host info.

resume (   self )

Resumes the operation of the attached kioslave.

send (  self,
int  cmd,
QByteArray  arr=QByteArray()
)

Sends the given command to the kioslave.

Parameters:
cmd  command id
arr  byte array containing data

setConfig (  self,
KIO.MetaData  config
)

Configure slave

setConnected (  self,
bool  c
)
setHost (  self,
QString  host,
int  port,
QString  user,
QString  passwd
)

Set host for url

Parameters:
host  to connect to.
port  to connect to.
user  to login as
passwd  to login with

setIdle (   self )

Marks this slave as idle.

setPID (  self,
pid_t  a0
)
setProtocol (  self,
QString  protocol
)
slaveDied (  self,
KIO.Slave  slave
)
Signal syntax:
QObject.connect(source, SIGNAL("slaveDied(Slave*)"), target_slot)
QString slaveProtocol (   self )

The actual protocol used to handle the request.

This method will return a different protocol than the one obtained by using protocol() if a proxy-server is used for the given protocol. This usually means that this method will return "http" when the actuall request was to retrieve a resource from an "ftp" server by going through a proxy server.

Returns:
the actual protocol (io-slave) that handled the request

int slave_pid (   self )
suspend (   self )

Suspends the operation of the attached kioslave.

bool suspended (   self )

Tells whether the kioslave is suspended.

Returns:
true if the kioslave is suspended.

timeout (   self )
QString user (   self )

Returns:
User this slave is (was?) logged in as

  • Full Index

Modules

  • akonadi
  • dnssd
  • kdecore
  • kdeui
  • khtml
  • kio
  • knewstuff
  • kparts
  • kutils
  • nepomuk
  • phonon
  • plasma
  • solid
  • soprano
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal