(self, text, fname='.syncplay.log')
| 224 | _error = None |
| 225 | |
| 226 | def write(self, text, fname='.syncplay.log'): |
| 227 | if self._file is None and self._error is None: |
| 228 | if os.name != 'nt': |
| 229 | path = os.path.join(os.getenv('HOME', '.'), fname) |
| 230 | else: |
| 231 | path = os.path.join(os.getenv('APPDATA', '.'), fname) |
| 232 | self._file = open(path, 'a', encoding='utf-8') |
| 233 | # TODO: Handle errors. |
| 234 | if self._file is not None: |
| 235 | if not (text.startswith("<frozen zipimport>") and "UserWarning:" in text): |
| 236 | self._file.write(text) |
| 237 | self._file.flush() |
| 238 | |
| 239 | def flush(self): |
| 240 | if self._file is not None: |
no test coverage detected