MCPcopy Create free account
hub / github.com/Syncplay/syncplay / write

Method write

syncplay/utils.py:226–237  ·  view source on GitHub ↗
(self, text, fname='.syncplay.log')

Source from the content-addressed store, hash-verified

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:

Callers 3

createMethod · 0.45
showDebugMessageMethod · 0.45
savePlaylistToFileMethod · 0.45

Calls 1

flushMethod · 0.45

Tested by

no test coverage detected