2
2
3
3
import os .path
4
4
5
- from .whiteutils import reindentBlock
5
+ from .whiteutils import reindent_block
6
6
7
7
8
- def makeFiles (d , basedir = "." ):
8
+ def make_files (d , basedir = "." ):
9
9
"""Create files from the dictionary `d` in the directory named by `basedir`."""
10
10
for name , contents in d .items ():
11
11
child = os .path .join (basedir , name )
@@ -14,14 +14,14 @@ def makeFiles(d, basedir="."):
14
14
if isinstance (contents , bytes ):
15
15
mode += "b"
16
16
with open (child , mode ) as f :
17
- f .write (reindentBlock (contents ))
17
+ f .write (reindent_block (contents ))
18
18
else :
19
19
if not os .path .exists (child ):
20
20
os .mkdir (child )
21
- makeFiles (contents , child )
21
+ make_files (contents , child )
22
22
23
23
24
- def removeFiles (d , basedir = "." ):
24
+ def remove_files (d , basedir = "." ):
25
25
"""Remove the files created by `makeFiles`.
26
26
27
27
Directories are removed if they are empty.
@@ -32,6 +32,6 @@ def removeFiles(d, basedir="."):
32
32
if isinstance (contents , (bytes , str )):
33
33
os .remove (child )
34
34
else :
35
- removeFiles (contents , child )
35
+ remove_files (contents , child )
36
36
if not os .listdir (child ):
37
37
os .rmdir (child )
0 commit comments