Changeset 781:d4455b2cd469 for src/mlx
- Timestamp:
- 05/22/16 06:42:44 (9 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/update.py
r681 r781 297 297 #------------------------------------------------------------------------------ 298 298 299 def removeFiles(directory, listener, removed, count): 300 """Remove the given files.""" 301 toremoveDir = None 302 303 listener.startRemoving() 304 305 removed.sort(reverse = True) 306 for path in removed: 307 removePath = createLocalPath(directory, path) 308 removeFile(toremoveDir, directory, removePath) 309 310 removeDirectory = os.path.dirname(removePath) 311 try: 312 os.removedirs(removeDirectory) 313 except: 314 pass 315 316 count += 1 317 listener.removed(path, count) 318 319 return count 320 321 #------------------------------------------------------------------------------ 322 299 323 def updateFiles(directory, updateURL, listener, 300 324 manifest, modifiedAndNew, removed, localRemoved): … … 314 338 updateURL += "/" + os.name 315 339 340 removeCount = 0 341 if localRemoved: 342 removeCount = removeFiles(directory, listener, 343 localRemoved, removeCount) 344 316 345 for (path, size, sum) in modifiedAndNew: 317 346 targetFile = createLocalPath(directory, path) … … 346 375 count += 1 347 376 listener.renamed(path, count) 348 349 listener.startRemoving() 350 count = 0 351 removed += localRemoved 352 removed.sort(reverse = True) 353 for path in removed: 354 removePath = createLocalPath(directory, path) 355 removeFile(toremoveDir, directory, removePath) 356 357 removeDirectory = os.path.dirname(removePath) 358 try: 359 os.removedirs(removeDirectory) 360 except: 361 pass 362 363 count += 1 364 listener.removed(path, count) 377 378 removeFiles(directory, listener, removed, removeCount) 365 379 366 380 listener.writingManifest()
Note:
See TracChangeset
for help on using the changeset viewer.