File indexing completed on 2024-04-28 15:53:57

0001 # AUTO-GENERATED FILE -- DO NOT EDIT
0002 
0003 """ A simple fast partial StringIO replacement.
0004 
0005 This module provides a simple useful replacement for
0006 the StringIO module that is written in C.  It does not provide the
0007 full generality of StringIO, but it provides enough for most
0008 applications and is especially useful in conjunction with the
0009 pickle module.
0010 
0011 Usage:
0012 
0013   from cStringIO import StringIO
0014 
0015   an_output_stream=StringIO()
0016   an_output_stream.write(some_stuff)
0017   ...
0018   value=an_output_stream.getvalue()
0019 
0020   an_input_stream=StringIO(a_string)
0021   spam=an_input_stream.readline()
0022   spam=an_input_stream.read(5)
0023   an_input_stream.seek(0)           # OK, start over
0024   spam=an_input_stream.read()       # and read it all
0025   
0026 If someone else wants to provide a more complete implementation,
0027 go for it. :-)  
0028 
0029 cStringIO.c,v 1.29 1999/06/15 14:10:27 jim Exp
0030  """
0031 
0032 class InputType(object):
0033   """ Simple type for treating strings as input file streams """
0034 
0035   def close(self):
0036     """ close(): explicitly release resources held. """
0037     pass
0038 
0039   closed = property(None, None, None,
0040                     """ True if the file is closed """
0041                     )
0042 
0043 
0044   def flush(self):
0045     """ flush(): does nothing. """
0046     pass
0047 
0048   def getvalue(self, use_pos=None):
0049     """ getvalue([use_pos]) -- Get the string value.
0050     If use_pos is specified and is a true value, then the string returned
0051     will include only the text up to the current file position.
0052      """
0053     return ""
0054 
0055   def isatty(self):
0056     """ isatty(): always returns 0 """
0057     pass
0058 
0059   def next(self):
0060     """ x.next() -> the next value, or raise StopIteration """
0061     return None
0062 
0063   def read(self, s=None):
0064     """ read([s]) -- Read s characters, or the rest of the string """
0065     return ""
0066 
0067   def readline(self):
0068     """ readline() -- Read one line """
0069     return None
0070 
0071   def readlines(self):
0072     """ readlines() -- Read all lines """
0073     return None
0074 
0075   def reset(self):
0076     """ reset() -- Reset the file position to the beginning """
0077     return file(__file__)
0078 
0079   def seek(self, position):
0080     """ seek(position)       -- set the current position
0081     seek(position, mode) -- mode 0: absolute; 1: relative; 2: relative to EOF """
0082     return None
0083 
0084   def tell(self):
0085     """ tell() -- get the current position. """
0086     return None
0087 
0088   def truncate(self):
0089     """ truncate(): truncate the file at the current position. """
0090     pass
0091 
0092 class OutputType(object):
0093   """ Simple type for output to strings. """
0094 
0095   def close(self):
0096     """ close(): explicitly release resources held. """
0097     pass
0098 
0099   closed = property(None, None, None,
0100                     """ True if the file is closed """
0101                     )
0102 
0103 
0104   def flush(self):
0105     """ flush(): does nothing. """
0106     pass
0107 
0108   def getvalue(self, use_pos=None):
0109     """ getvalue([use_pos]) -- Get the string value.
0110     If use_pos is specified and is a true value, then the string returned
0111     will include only the text up to the current file position.
0112      """
0113     return ""
0114 
0115   def isatty(self):
0116     """ isatty(): always returns 0 """
0117     pass
0118 
0119   def next(self):
0120     """ x.next() -> the next value, or raise StopIteration """
0121     return None
0122 
0123   def read(self, s=None):
0124     """ read([s]) -- Read s characters, or the rest of the string """
0125     return ""
0126 
0127   def readline(self):
0128     """ readline() -- Read one line """
0129     return None
0130 
0131   def readlines(self):
0132     """ readlines() -- Read all lines """
0133     return None
0134 
0135   def reset(self):
0136     """ reset() -- Reset the file position to the beginning """
0137     return file(__file__)
0138 
0139   def seek(self, position):
0140     """ seek(position)       -- set the current position
0141     seek(position, mode) -- mode 0: absolute; 1: relative; 2: relative to EOF """
0142     return None
0143 
0144   softspace = None
0145 
0146   def tell(self):
0147     """ tell() -- get the current position. """
0148     return None
0149 
0150   def truncate(self):
0151     """ truncate(): truncate the file at the current position. """
0152     pass
0153 
0154   def write(self, s):
0155     """ write(s) -- Write a string to the file
0156     
0157     Note (hack:) writing None resets the buffer """
0158     return ""
0159 
0160   def writelines(self, sequence_of_strings):
0161     """ writelines(sequence_of_strings) -> None.  Write the strings to the file.
0162     
0163     Note that newlines are not added.  The sequence can be any iterable object
0164     producing strings. This is equivalent to calling write() for each string. """
0165     return ""
0166 
0167 def StringIO(s=None):
0168   """ StringIO([s]) -- Return a StringIO-like stream for reading or writing """
0169   return ""
0170 
0171 __package__ = None
0172 cStringIO_CAPI = None
0173