@@ -105,53 +105,6 @@ def dict_md5(d, exclude=()):
105105 return bytes_md5 (byts )
106106
107107
108- def copyfile (src , dest , no_progress_bar = False , name = None ):
109- """Copy file with progress bar"""
110- from dvc .exceptions import DvcException
111- from dvc .progress import Tqdm
112- from dvc .system import System
113-
114- src = fspath_py35 (src )
115- dest = fspath_py35 (dest )
116-
117- name = name if name else os .path .basename (dest )
118- total = os .stat (src ).st_size
119-
120- if os .path .isdir (dest ):
121- dest = os .path .join (dest , os .path .basename (src ))
122-
123- try :
124- System .reflink (src , dest )
125- except DvcException :
126- with Tqdm (
127- desc = name , disable = no_progress_bar , total = total , bytes = True
128- ) as pbar :
129- with open (src , "rb" ) as fsrc , open (dest , "wb+" ) as fdest :
130- while True :
131- buf = fsrc .read (LOCAL_CHUNK_SIZE )
132- if not buf :
133- break
134- fdest .write (buf )
135- pbar .update (len (buf ))
136-
137-
138- def makedirs (path , exist_ok = False , mode = None ):
139- path = fspath_py35 (path )
140-
141- if mode is None :
142- os .makedirs (path , exist_ok = exist_ok )
143- return
144-
145- # utilize umask to set proper permissions since Python 3.7 the `mode`
146- # `makedirs` argument no longer affects the file permission bits of
147- # newly-created intermediate-level directories.
148- umask = os .umask (0o777 - mode )
149- try :
150- os .makedirs (path , exist_ok = exist_ok )
151- finally :
152- os .umask (umask )
153-
154-
155108def _split (list_to_split , chunk_size ):
156109 return [
157110 list_to_split [i : i + chunk_size ]
@@ -278,12 +231,6 @@ def to_yaml_string(data):
278231 return stream .getvalue ()
279232
280233
281- def walk_files (directory ):
282- for root , _ , files in os .walk (fspath (directory )):
283- for f in files :
284- yield os .path .join (root , f )
285-
286-
287234def colorize (message , color = None ):
288235 """Returns a message in a specified color."""
289236 if not color :
0 commit comments