MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _move_path_to_path_or_stream

Function _move_path_to_path_or_stream

lib/matplotlib/backends/backend_ps.py:75–88  ·  view source on GitHub ↗

Move the contents of file at *src* to path-or-filelike *dst*. If *dst* is a path, the metadata of *src* are *not* copied.

(src, dst)

Source from the content-addressed store, hash-verified

73
74
75def _move_path_to_path_or_stream(src, dst):
76 """
77 Move the contents of file at *src* to path-or-filelike *dst*.
78
79 If *dst* is a path, the metadata of *src* are *not* copied.
80 """
81 if is_writable_file_like(dst):
82 fh = (open(src, encoding='latin-1')
83 if file_requires_unicode(dst)
84 else open(src, 'rb'))
85 with fh:
86 shutil.copyfileobj(fh, dst)
87 else:
88 shutil.move(src, dst, copy_function=shutil.copyfile)
89
90
91def _font_to_ps_type3(font_path, subset_index, glyph_indices):

Callers 2

_print_figureMethod · 0.85
_print_figure_texMethod · 0.85

Calls 2

is_writable_file_likeFunction · 0.90
file_requires_unicodeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…