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