| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python2.6/site-packages/papyon/ |
Upload File : |
Ñò
O Jc @ sß d Z d d k Z d d k Z d d k Z d d k Z d d k Z d d g Z e i d ƒ Z d e f d „ ƒ YZ
e i Z d e i
f d „ ƒ YZ e i e ƒ d e f d „ ƒ YZ e i e ƒ d
e f d „ ƒ YZ d S( sh Network Transport Layer
This module provides an abstraction of the transport to be used to communicate
with the MSN servers, actually MSN servers can communicate either through
direct connection using TCP/1863 or using TCP/80 by tunelling the protocol
inside HTTP POST requests.
The classes of this module are structured as follow:
G{classtree BaseTransport}iÿÿÿÿNt
ServerTypet DirectConnections papyon.transportc B s e Z d Z d Z RS( t SBt NS( t __name__t
__module__t SWITCHBOARDt NOTIFICATION( ( ( s4 /usr/lib/python2.6/site-packages/papyon/transport.pyR , s t
BaseTransportc B s e Z d Z h e i e i e f f d 6e i e i d f d 6e i e i d f d 6e i e i e f f d 6e i e i e f f d 6e i e i e f f d 6Z e i h d „ Z
e d „ ƒ Z d „ Z
d
„ Z d d „ Z e d d „ Z d d e d d
„ Z d „ Z d „ Z RS( sù Abstract Base Class that modelize a connection to the MSN service, this
abstraction is used to build various transports that expose the same
interface, basically a transport is created using its constructor then it
simply emits signals when network events (or even abstracted network events)
occur, for example a Transport that successfully connected to the MSN
service will emit a connection-success signal, and when that transport
received a meaningful message it would emit a command-received signal.
@ivar server: the server being used to connect to
@type server: tuple(host, port)
@ivar server_type: the server that we are connecting to, either
Notification or switchboard.
@type server_type: L{ServerType}
@ivar proxies: proxies that we can use to connect
@type proxies: dict(type => L{gnet.proxy.ProxyInfos})
@ivar transaction_id: the current transaction ID
@type transaction_id: integer
@cvar connection-failure: signal emitted when the connection fails
@type connection-failure: ()
@cvar connection-success: signal emitted when the connection succeed
@type connection-success: ()
@cvar connection-reset: signal emitted when the connection is being
reset
@type connection-reset: ()
@cvar connection-lost: signal emitted when the connection was lost
@type connection-lost: ()
@cvar command-received: signal emitted when a command is received
@type command-received: FIXME
@cvar command-sent: signal emitted when a command was successfully
transmitted to the server
@type command-sent: FIXME
@undocumented: __gsignals__s connection-failures connection-successs connection-resets connection-losts command-receiveds command-sentc C s8 t i i | ƒ | | _ | | _ | | _ d | _ d S( s¿ Connection initialization
@param server: the server to connect to.
@type server: (host: string, port: integer)
@param server_type: the server that we are connecting to, either
Notification or switchboard.
@type server_type: L{ServerType}
@param proxies: proxies that we can use to connect
@type proxies: {type: string => L{gnet.network.ProxyInfos}}i N( t gobjectt GObjectt __init__t servert server_typet proxiest _transaction_id( t selfR R
R ( ( s4 /usr/lib/python2.6/site-packages/papyon/transport.pyR y s
c C s | i S( N( R ( R ( ( s4 /usr/lib/python2.6/site-packages/papyon/transport.pyt transaction_id‹ s c C s
t ‚ d S( s Connect to the server serverN( t NotImplementedError( R ( ( s4 /usr/lib/python2.6/site-packages/papyon/transport.pyt establish_connection s c C s
t ‚ d S( s Disconnect from the serverN( R ( R ( ( s4 /usr/lib/python2.6/site-packages/papyon/transport.pyt lose_connection” s c C s
t ‚ d S( sª Reset the connection
@param server: when set, reset the connection and
connect to this new server
@type server: tuple(host, port)N( R ( R R ( ( s4 /usr/lib/python2.6/site-packages/papyon/transport.pyt reset_connection˜ s c G s
t ‚ d S( sâ
Sends a L{msnp.Command} to the server.
@param command: command to send
@type command: L{msnp.Command}
@param increment: if False, the transaction ID is not incremented
@type increment: bool
@param callback: callback to be used when the command has been
transmitted
@type callback: callable
@param cb_args: callback arguments
@type cb_args: Any, ...
N( R ( R t commandt incrementt callbackt cb_args( ( s4 /usr/lib/python2.6/site-packages/papyon/transport.pyt send_command¡ s c G s? t i ƒ } | i | | i | | Œ | i | | | | Œ | S( sÛ
Builds a command object then send it to the server.
@param command: the command name, must be a 3 letters
uppercase string.
@type command: string
@param arguments: command arguments
@type arguments: (string, ...)
@param payload: payload data
@type payload: string
@param increment: if False, the transaction ID is not incremented
@type increment: bool
@param callback: callback to be used when the command has been
transmitted
@type callback: callable
@param cb_args: callback arguments
@type cb_args: tuple
( t msnpt Commandt buildR R ( R R t argumentst payloadR R R t cmd( ( s4 /usr/lib/python2.6/site-packages/papyon/transport.pyt send_command_ex´ s c C s d S( N( ( R ( ( s4 /usr/lib/python2.6/site-packages/papyon/transport.pyt enable_pingÒ s c C s | i d 7_ | i S( sV Increments the Transaction ID then return it.
@rtype: integeri ( R ( R ( ( s4 /usr/lib/python2.6/site-packages/papyon/transport.pyt _increment_transaction_idÕ s ( ( N( ( R R t __doc__R t SIGNAL_RUN_FIRSTt TYPE_NONEt objectt __gsignals__R R R t propertyR R R t NoneR t TrueR R! R"