Back to index

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

List of all members.

Public Member Functions

def __init__
def read
def getcomptype
def close

Public Attributes

 fileobj
 buf
 read
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Small proxy class that enables transparent compression
   detection for the Stream interface (mode 'r|*').

Definition at line 611 of file tarfile.py.


Constructor & Destructor Documentation

def tarfile._StreamProxy.__init__ (   self,
  fileobj 
)

Definition at line 616 of file tarfile.py.

00616 
00617     def __init__(self, fileobj):
00618         self.fileobj = fileobj
00619         self.buf = self.fileobj.read(BLOCKSIZE)

Here is the caller graph for this function:


Member Function Documentation

Definition at line 631 of file tarfile.py.

00631 
00632     def close(self):
00633         self.fileobj.close()
00634 # class StreamProxy

Here is the caller graph for this function:

Definition at line 624 of file tarfile.py.

00624 
00625     def getcomptype(self):
00626         if self.buf.startswith(b"\037\213\010"):
00627             return "gz"
00628         if self.buf.startswith(b"BZh91"):
00629             return "bz2"
00630         return "tar"

def tarfile._StreamProxy.read (   self,
  size 
)

Definition at line 620 of file tarfile.py.

00620 
00621     def read(self, size):
00622         self.read = self.fileobj.read
00623         return self.buf

Here is the caller graph for this function:


Member Data Documentation

Definition at line 618 of file tarfile.py.

Definition at line 617 of file tarfile.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 621 of file tarfile.py.


The documentation for this class was generated from the following file: