X Tutup
Skip to content

Commit 1e0be5d

Browse files
committed
Replace map/lambda with list comprehension to copy files into target directory.
git-svn-id: https://src.springframework.org/svn/se-springpython-py/trunk/springpython@293 ce8fead1-4192-4296-8608-a705134b927f
1 parent 12593dd commit 1e0be5d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

build.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,13 @@ def register():
167167
os.system("cd src ; python setup.py register")
168168
os.system("cd samples ; python setup.py register")
169169

170-
# Using glob, generate a list of files, then use map to go over each item, and copy it
171-
# from source to destination.
172170
def copy(src, dest, patterns):
173171
if not os.path.exists(dest):
174172
print "+++ Creating " + dest
175173
os.makedirs(dest)
176174

177-
map(lambda pattern: [shutil.copy(file, dest) for file in glob(src + pattern)], patterns)
178-
175+
[shutil.copy(file, dest) for pattern in patterns for file in glob(src + pattern)]
176+
179177
def setup(root, stylesheets=True):
180178
copy(
181179
p["doc.ref.dir"]+"/src/images/",

0 commit comments

Comments
 (0)
X Tutup