(self, text)
| 1147 | return len(list(self.iterkeys())) |
| 1148 | |
| 1149 | def _open_mh_sequences_file(self, text): |
| 1150 | mode = '' if text else 'b' |
| 1151 | kwargs = {'encoding': 'ASCII'} if text else {} |
| 1152 | path = os.path.join(self._path, '.mh_sequences') |
| 1153 | while True: |
| 1154 | try: |
| 1155 | return open(path, 'r+' + mode, **kwargs) |
| 1156 | except FileNotFoundError: |
| 1157 | pass |
| 1158 | try: |
| 1159 | return open(path, 'x+' + mode, **kwargs) |
| 1160 | except FileExistsError: |
| 1161 | pass |
| 1162 | |
| 1163 | def lock(self): |
| 1164 | """Lock the mailbox.""" |
no test coverage detected