Home | History | Annotate | Download | only in python2.7

Lines Matching full:_file

576         self._file = f
625 _lock_file(self._file)
631 _unlock_file(self._file)
640 _sync_flush(self._file)
649 # Check length of self._file; if it's changed, some other process
651 self._file.seek(0, 2)
652 cur_len = self._file.tell()
664 self._file.seek(start)
668 buffer = self._file.read(min(4096,
669 stop - self._file.tell()))
681 # self._file is about to get replaced, so no need to sync.
682 self._file.close()
695 self._file = open(self._path, 'rb+')
700 _lock_file(self._file, dotlock=False)
719 self._file.close() # Sync has been done by self.flush() above.
733 self._file.seek(0, 2)
734 before = self._file.tell()
740 self._pre_mailbox_hook(self._file)
742 self._pre_message_hook(self._file)
744 self._post_message_hook(self._file)
746 self._file.truncate(before)
748 self._file.flush()
749 self._file_length = self._file.tell() # Record current length of mailbox
762 self._file.seek(start)
763 from_line = self._file.readline().replace(os.linesep, '')
764 string = self._file.read(stop - self._file.tell())
772 self._file.seek(start)
774 self._file.readline()
775 string = self._file.read(stop - self._file.tell())
781 self._file.seek(start)
783 self._file.readline()
784 return _PartialFile(self._file, self._file.tell(), stop)
787 """Format a message and blindly write to self._file."""
803 start = self._file.tell()
804 self._file.write(from_line + os.linesep)
805 self._dump_message(message, self._file, self._mangle_from_)
806 stop = self._file.tell()
832 self._file.seek(0)
834 line_pos = self._file.tell()
835 line = self._file.readline()
859 self._file_length = self._file.tell()
881 self._file.seek(0)
885 line = self._file.readline()
886 next_pos = self._file.tell()
891 line = self._file.readline()
892 next_pos = self._file.tell()
903 self._file.seek(0, 2)
904 self._file_length = self._file.tell()
1071 self._file = open(os.path.join(self._path, '.mh_sequences'), 'rb+')
1072 _lock_file(self._file)
1078 _unlock_file(self._file)
1079 _sync_close(self._file)
1080 del self._file
1251 self._file.seek(start)
1252 self._file.readline() # Skip '1,' line specifying labels.
1255 line = self._file.readline()
1261 line = self._file.readline()
1265 body = self._file.read(stop - self._file.tell()).replace(os.linesep,
1276 self._file.seek(start)
1277 self._file.readline() # Skip '1,' line specifying labels.
1280 line = self._file.readline()
1285 line = self._file.readline()
1289 self._file.read(stop - self._file.tell()).replace(os.linesep,
1309 self._file.seek(0)
1314 line = self._file.readline()
1315 next_pos = self._file.tell()
1321 in self._file.readline()[1:].split(',')
1333 self._file.seek(0, 2)
1334 self._file_length = self._file.tell()
1352 start = self._file.tell()
1361 self._file.write('1')
1363 self._file.write(', ' + label)
1364 self._file.write(',,')
1366 self._file.write(' ' + label + ',')
1367 self._file.write(os.linesep)
1369 self._file.write('1,,' + os.linesep)
1377 self._file.write(line.replace('\n', os.linesep))
1380 self._file.write('*** EOOH ***' + os.linesep)
1387 self._file.write(line.replace('\n', os.linesep))
1394 self._file.write(line.replace('\n', os.linesep))
1401 self._file.write(buffer.replace('\n', os.linesep))
1405 self._file.write(message[:body_start].replace('\n',
1407 self._file.write('*** EOOH ***' + os.linesep)
1408 self._file.write(message[:body_start].replace('\n',
1410 self._file.write(message[body_start:].replace('\n',
1413 self._file.write('*** EOOH ***' + os.linesep + os.linesep)
1414 self._file.write(message.replace('\n', os.linesep))
1420 self._file.write(line.replace('\n', os.linesep))
1424 self._file.write('*** EOOH ***' + os.linesep)
1432 self._file.write(buffer.replace('\n', os.linesep))
1435 stop = self._file.tell()
1865 self._file = f
1873 return self._read(size, self._file.read)
1877 return self._read(size, self._file.readline)
1901 self._file.seek(self._pos)
1902 self._file.seek(offset, whence)
1903 self._pos = self._file.tell()
1907 if hasattr(self, '_file'):
1908 if hasattr(self._file, 'close'):
1909 self._file.close()
1910 del self._file
1916 self._file.seek(self._pos)
1918 self._pos = self._file.tell()
1957 if hasattr(self, '_file'):
1958 del self._file