| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
skypekit.Cached --+
|
skypekit.Object --+
|
Transfer
Transfer in this context refers to transferring (sending/receiving) files among Skype Contacts, not transferring a call to another Skype or PSTN Contact. This class includes file transfer-specific properties and methods, such as FILESIZE, BYTESPERSECOND, Pause and Resume. Recipients of these file transfers must explicitly accept (or decline) any incoming transfer. Transfer instances represent files being sent and received within a Conversation context. Each Transfer instance represents a single file transfer - if a conversation has multiple remote participants, a separate Transfer instance must be instantiated for each remote participant (a Transfer instance is not instantiated for the sender).
Transfer instances cannot be instantiated directly. Instead, you initiate a file transfer by invoking Conversation::PostFiles. This instantiates a Message instance of type POSTED_FILES, which is added to the Conversation for all the participants (including the sender). The Transfer instance is associated with this Message instance, and the Message::P_BODY_XML looks like this:
:
Some text<files alt=""><file size="2336020" index="0">test.zip</file></files>
To put it another way, the object chain goes like this: :
Conversation->Message->Transfer
The first part of the message (before the files section) comes from the Conversation::PostFiles body argument. For each file in the message, a file section is provided with three fields:
For practical purposes, the Message::P_BODY_XML property is not all that useful in this context. The Transfer instances, however, contain the state and progress feedback for your UI. You retrieve these Transfer instances using Message::GetTransfers method. Since the sender can post multiple files to a Conversation using the same Message, Message:GetTransfers retrieves a list of Transfer instances - one per file per recipient.
You can determine the direction of particular Transfer instance by querying Transfer::P_TYPE (INCOMING/OUTGOING).
You can implement a progress indicator by monitoring Transfer::P_BYTESTRANSFERRED. Note that when testing this on your local network, you will most likely catch these property change events at the beginning and the end of the transfer only - which does not look like too useful. However, for non-local network transfers where the transfer speeds are in the neighborhood of 200-300 KB per second, you should consider implementing progress feedback as being mandatory and expect to catch multiple property change events for all but the smallest files.
Another property of interest is Transfer::P_STATUS. The normal transfer status sequence during successful outgoing transfer is this:
The list of all terminal Transfer statuses is:
In-progress transfers can be canceled with Transfer::Cancel and paused/resumed with Transfer::Pause and Transfer::Resume. For transfers that complete with a status of FAILED, your UI should provide feedback based on the value of Transfer::P_FAILUREREASON.
Incoming transfers, once accepted, overwrite existing files with the same name. Before accepting an incoming file transfer, your UI should prompt the recipient to:
Similarly, your UI should verify the existence of outgoing files prior to invoking Conversation::PostFiles.
Note that you should provide both Conversation::PostFiles and Transfer::Accept methods fully-qualified paths. Otherwise, the paths will be assumed to be relative to the path of SkypeKit runtime, since the methods are actually executed in the runtime context.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from |
|||
| Static Methods | |||
|
|||
|
Inherited from |
|||
| Class Variables | |
event_handlers =
|
|
propid2label =
|
|
module_id = 6
|
|
TYPE = INCOMING |
|
STATUS = Recognized values for the P_STATUS property. |
|
FAILUREREASON = SENDER_NOT_AUTHORISED |
|
P_TYPE = 80
|
|
P_PARTNER_HANDLE = 81
|
|
P_PARTNER_DISPNAME = 82
|
|
P_STATUS = 83
|
|
P_FAILUREREASON = 84
|
|
P_STARTTIME = 85
|
|
P_FINISHTIME = 86
|
|
P_FILEPATH = 87
|
|
P_FILENAME = 88
|
|
P_FILESIZE = 89
|
|
P_BYTESTRANSFERRED = 90
|
|
P_BYTESPERSECOND = 91
|
|
P_CHATMSG_GUID = 92
|
|
P_CHATMSG_INDEX = 93
|
|
P_CONVO_ID = 98
|
|
|
Inherited from |
|
| Instance Variables | |
|
Inherited from |
| Properties | |
|
type INCOMING / OUTGOING |
|
|
partner_handle Skype Name of the remote party of the file transfer. |
|
|
partner_dispname Display name of the remote participant. |
|
|
status Current state of the transfer |
|
|
failurereason Set whenever P_STATUS transitions to FAILED. |
|
|
starttime UNIX timestamp of when this Transfer instance was instantiated, not when the transfer process actually started (was accepted from receiver side). |
|
|
finishtime UNIX timestamp of when this Transfer COMPLETED or FAILED. |
|
|
filepath The path -and- filename of the file being transfered (typically fully qualified). |
|
|
filename The filename -only- of the file being transfered. |
|
|
filesize The size of the file being transferred in bytes. |
|
|
bytestransferred The number of bytes already transferred. |
|
|
bytespersecond Current data transfer speed in bytes per second. |
|
|
chatmsg_guid The "global ID" of this Transfer's associated Message instance. |
|
|
chatmsg_index A more or less arbitrary index for ordering multiple file transfers within the UI. |
|
|
convo_id The "global ID" of this Transfer's associated Conversation (as chained through its associated Message). |
|
|
Inherited from |
|
| Method Details |
actual constructor
|
str(x)
|
Accepts an incoming file transfer and saves it to specified file on the local file system. If the specified file exists, SkypeKit will silently overwrite it. Your UI should prompting the user for confirmation in this case and provide a means for canceling the file transfer or specifying a different target file. Arguments:
Return values:
|
Temporarily pauses an in-progress incoming or outgoing file transfer. For incoming transfers, only this affects the sender and the invoking recipient only. For outgoing transfers, this affects the sender and all recipients. |
Cancels an in-progress file transfer. Transfer::STATUS will transition to CANCELLED for incoming file transfers and to CANCELLED_BY_REMOTE for outgoing transfers. |
| Class Variable Details |
propid2label
|
TYPE
|
STATUSRecognized values for the P_STATUS property. Reflects current state of this Transfer.
|
FAILUREREASON
|
| Property Details |
typeINCOMING / OUTGOING
|
partner_handleSkype Name of the remote party of the file transfer. If a file is posted in a conversation with more than one participant, Transfer objects are created for each of them - so a transfer is always to one single remote target.
|
partner_dispnameDisplay name of the remote participant.
|
statusCurrent state of the transfer
|
failurereasonSet whenever P_STATUS transitions to FAILED.
|
starttimeUNIX timestamp of when this Transfer instance was instantiated, not when the transfer process actually started (was accepted from receiver side). Do not use this property when calculate the data transfer speed! Instead, monitor changes to P_BYTESPERSECOND.
|
finishtimeUNIX timestamp of when this Transfer COMPLETED or FAILED. This property is never set if the receiving side (local or remote) canceled the transfer.
|
filepathThe path -and- filename of the file being transfered (typically fully qualified). For the receiver, SkypeKit sets this property upon acceptance of the incoming transfer. If not fully qualified, the path is assumed to be relative to the path of the SkypeKit runtime.
|
filenameThe filename -only- of the file being transfered. The receiver side can use this property to pre-populate relevant UI components while prompting the user to accept the incoming transfer.
|
filesizeThe size of the file being transferred in bytes. Depending on the magnitude of this value, your UI might want to display the size in terms of kilobytes or even megabytes.
|
bytestransferredThe number of bytes already transferred. Calculate the percentage of the file transferred so far as: : P_BYTESTRANSFERRED / (P_FILESIZE / 100); Use float variables to avoid problems with files smaller than 100 bytes!
|
bytespersecondCurrent data transfer speed in bytes per second. Typically, your UI will want to display this value as kilobytes per second (KBps).
|
chatmsg_guidThe "global ID" of this Transfer's associated Message instance. GUIDs are shared across Skype client instances and across all users that can see this Message.
|
chatmsg_indexA more or less arbitrary index for ordering multiple file transfers within the UI.
|
convo_idThe "global ID" of this Transfer's associated Conversation (as chained through its associated Message). GUIDs are shared across Skype client instances and across all users that can see this Conversation. Note that currently SkypeKit sets this property for INCOMING file transfers only and returns 0 (zero) for all sending side transfers. This is a known bug.
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Fri Jan 27 18:21:14 2012 | http://epydoc.sourceforge.net |