MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _deleteFiles_SMB1__list

Method _deleteFiles_SMB1__list

pager_lib/smb/base.py:2708–2735  ·  view source on GitHub ↗
(self, service_name, path, pattern, delete_matching_folders, callback, errback, timeout = 30)

Source from the content-addressed store, hash-verified

2706 self._deleteFiles_SMB1__list(service_name, path, pattern, delete_matching_folders, listCB, errback, timeout)
2707
2708 def _deleteFiles_SMB1__list(self, service_name, path, pattern, delete_matching_folders, callback, errback, timeout = 30):
2709 folder_queue = [ ]
2710 files_list = [ ]
2711 current_path = [ path ]
2712 search = SMB_FILE_ATTRIBUTE_READONLY | SMB_FILE_ATTRIBUTE_HIDDEN | SMB_FILE_ATTRIBUTE_SYSTEM | SMB_FILE_ATTRIBUTE_DIRECTORY | SMB_FILE_ATTRIBUTE_ARCHIVE | SMB_FILE_ATTRIBUTE_INCL_NORMAL
2713
2714 def listCB(results):
2715 files = [ ]
2716 for f in filter(lambda x: x.filename not in [ '.', '..' ], results):
2717 if f.isDirectory:
2718 if delete_matching_folders:
2719 folder_queue.append(current_path[0]+'\\'+f.filename)
2720 else:
2721 files.append(( current_path[0], f.filename ))
2722 if current_path[0]!=path and delete_matching_folders:
2723 files.append(( current_path[0], None ))
2724
2725 if files:
2726 files_list[0:0] = files
2727
2728 if folder_queue:
2729 p = folder_queue.pop()
2730 current_path[0] = p
2731 self._listPath_SMB1(service_name, current_path[0], listCB, errback, search = search, pattern = '*', timeout = 30)
2732 else:
2733 callback(files_list)
2734
2735 self._listPath_SMB1(service_name, path, listCB, errback, search = search, pattern = pattern, timeout = timeout)
2736
2737 def _deleteFiles_SMB1__del(self, service_name, tid, path, callback, errback, timeout = 30):
2738 messages_history = [ ]

Callers 2

connectCBMethod · 0.95
_deleteFiles_SMB1Method · 0.95

Calls 1

_listPath_SMB1Method · 0.95

Tested by

no test coverage detected