mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-12-24 03:00:17 +00:00
Add docs for filesocket
This commit is contained in:
parent
b87c4d786d
commit
5f44c0e678
3 changed files with 27 additions and 10 deletions
12
docs/api/xmlstream/filesocket.rst
Normal file
12
docs/api/xmlstream/filesocket.rst
Normal file
|
@ -0,0 +1,12 @@
|
|||
.. module:: sleekxmpp.xmlstream.filesocket
|
||||
|
||||
.. _filesocket:
|
||||
|
||||
Python 2.6 File Socket Shims
|
||||
============================
|
||||
|
||||
.. autoclass:: FileSocket
|
||||
:members:
|
||||
|
||||
.. autoclass:: Socket26
|
||||
:members:
|
|
@ -114,6 +114,7 @@ API Reference
|
|||
api/basexmpp
|
||||
api/xmlstream/stanzabase
|
||||
api/xmlstream/tostring
|
||||
api/xmlstream/filesocket
|
||||
|
||||
Additional Info
|
||||
---------------
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
SleekXMPP: The Sleek XMPP Library
|
||||
Copyright (C) 2010 Nathanael C. Fritz
|
||||
This file is part of SleekXMPP.
|
||||
sleekxmpp.xmlstream.filesocket
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
See the file LICENSE for copying permission.
|
||||
This module is a shim for correcting deficiencies in the file
|
||||
socket implementation of Python2.6.
|
||||
|
||||
Part of SleekXMPP: The Sleek XMPP Library
|
||||
|
||||
:copyright: (c) 2011 Nathanael C. Fritz
|
||||
:license: MIT, see LICENSE for more details
|
||||
"""
|
||||
|
||||
from socket import _fileobject
|
||||
|
@ -12,12 +18,11 @@ import socket
|
|||
|
||||
class FileSocket(_fileobject):
|
||||
|
||||
"""
|
||||
Create a file object wrapper for a socket to work around
|
||||
"""Create a file object wrapper for a socket to work around
|
||||
issues present in Python 2.6 when using sockets as file objects.
|
||||
|
||||
The parser for xml.etree.cElementTree requires a file, but we will
|
||||
be reading from the XMPP connection socket instead.
|
||||
The parser for :class:`~xml.etree.cElementTree` requires a file, but
|
||||
we will be reading from the XMPP connection socket instead.
|
||||
"""
|
||||
|
||||
def read(self, size=4096):
|
||||
|
@ -31,8 +36,7 @@ class FileSocket(_fileobject):
|
|||
|
||||
class Socket26(socket._socketobject):
|
||||
|
||||
"""
|
||||
A custom socket implementation that uses our own FileSocket class
|
||||
"""A custom socket implementation that uses our own FileSocket class
|
||||
to work around issues in Python 2.6 when using sockets as files.
|
||||
"""
|
||||
|
||||
|
|
Loading…
Reference in a new issue