powcshell.shellfileop module#
シェル項目のファイル操作。
主なクラスは ShellFileOperation です。
- class powcshell.shellfileop.IFileOperation#
ベースクラス:
IUnknown- Advise = <COM method offset 3: WinFunctionType>#
- ApplyPropertiesToItem = <COM method offset 10: WinFunctionType>#
- ApplyPropertiesToItems = <COM method offset 11: WinFunctionType>#
- CopyItem = <COM method offset 16: WinFunctionType>#
- CopyItems = <COM method offset 17: WinFunctionType>#
- DeleteItem = <COM method offset 18: WinFunctionType>#
- DeleteItems = <COM method offset 19: WinFunctionType>#
- GetAnyOperationsAborted = <COM method offset 22: WinFunctionType>#
- MoveItem = <COM method offset 14: WinFunctionType>#
- MoveItems = <COM method offset 15: WinFunctionType>#
- NewItem = <COM method offset 20: WinFunctionType>#
- PerformOperations = <COM method offset 21: WinFunctionType>#
- RenameItem = <COM method offset 12: WinFunctionType>#
- RenameItems = <COM method offset 13: WinFunctionType>#
- SetOperationFlags = <COM method offset 5: WinFunctionType>#
- SetOwnerWindow = <COM method offset 9: WinFunctionType>#
- SetProgressDialog = <COM method offset 7: WinFunctionType>#
- SetProgressMessage = <COM method offset 6: WinFunctionType>#
- SetProperties = <COM method offset 8: WinFunctionType>#
- Unadvise = <COM method offset 4: WinFunctionType>#
- class powcshell.shellfileop.IFileOperationProgressSink#
ベースクラス:
IUnknown- FinishOperations = <COM method offset 4: WinFunctionType>#
- PauseTimer = <COM method offset 17: WinFunctionType>#
- PostCopyItem = <COM method offset 10: WinFunctionType>#
- PostDeleteItem = <COM method offset 12: WinFunctionType>#
- PostMoveItem = <COM method offset 8: WinFunctionType>#
- PostNewItem = <COM method offset 14: WinFunctionType>#
- PostRenameItem = <COM method offset 6: WinFunctionType>#
- PreCopyItem = <COM method offset 9: WinFunctionType>#
- PreDeleteItem = <COM method offset 11: WinFunctionType>#
- PreMoveItem = <COM method offset 7: WinFunctionType>#
- PreNewItem = <COM method offset 13: WinFunctionType>#
- PreRenameItem = <COM method offset 5: WinFunctionType>#
- ResetTimer = <COM method offset 16: WinFunctionType>#
- ResumeTimer = <COM method offset 18: WinFunctionType>#
- StartOperations = <COM method offset 3: WinFunctionType>#
- UpdateProgress = <COM method offset 15: WinFunctionType>#
- class powcshell.shellfileop.ShellFileOperation(o: Any)#
ベースクラス:
objectシェルのファイル操作。IShellItemインターフェイスのラッパーです。
- advise(sink: ShellFileOperationProgressSinkBase) int#
- advise_nothrow(sink: ShellFileOperationProgressSinkBase) ComResult[int]#
- property any_operationsaborted: bool#
- apply_propsitems(items: ShellItemArray | EnumShellItems) None#
- apply_propsitems_nothrow(items: ShellItemArray | EnumShellItems) ComResult[None]#
- copy_item(item: ShellItem, dest_folder: ShellItem, copy_name: str | None = None, sink: ShellFileOperationProgressSinkBase | None = None) None#
- copy_item_nothrow(item: ShellItem, dest_folder: ShellItem, copy_name: str | None = None, sink: ShellFileOperationProgressSinkBase | None = None) ComResult[None]#
- copy_items(items: ShellItemArray | EnumShellItems, dest_folder: ShellItem) None#
- copy_items_nothrow(items: ShellItemArray | EnumShellItems, dest_folder: ShellItem) ComResult[None]#
- static create() ShellFileOperation#
- delete_item(item: ShellItem, sink: ShellFileOperationProgressSinkBase | None = None) None#
- delete_item_nothrow(item: ShellItem, sink: ShellFileOperationProgressSinkBase | None = None) ComResult[None]#
- delete_items(items: ShellItemArray | EnumShellItems) None#
- delete_items_nothrow(items: ShellItemArray | EnumShellItems) ComResult[None]#
- move_item(item: ShellItem, dest_folder: ShellItem, new_name: str, sink: ShellFileOperationProgressSinkBase | None = None) None#
- move_item_nothrow(item: ShellItem, dest_folder: ShellItem, new_name: str, sink: ShellFileOperationProgressSinkBase | None = None) ComResult[None]#
- move_items(items: ShellItemArray | EnumShellItems, dest_folder: ShellItem) None#
- move_items_nothrow(items: ShellItemArray | EnumShellItems, dest_folder: ShellItem) ComResult[None]#
- new_item(dest_folder: ShellItem, attrs: ShellItemAttributeFlag | int, name: str, template_name: str | None = None, sink: ShellFileOperationProgressSinkBase | None = None) None#
- new_item_nothrow(dest_folder: ShellItem, attrs: ShellItemAttributeFlag | int, name: str, template_name: str | None = None, sink: ShellFileOperationProgressSinkBase | None = None) ComResult[None]#
- perform_operations() None#
- rename_item(item: ShellItem, new_name: str, sink: ShellFileOperationProgressSinkBase | None = None) None#
- rename_item_nothrow(item: ShellItem, new_name: str, sink: ShellFileOperationProgressSinkBase | None = None) ComResult[None]#
- rename_items(items: ShellItemArray | EnumShellItems, new_name: str) None#
- rename_items_nothrow(items: ShellItemArray | EnumShellItems, new_name: str) ComResult[None]#
- set_opflags(flags: ShellFileOperationFlag) None#
- set_opflags_nothrow(flags: ShellFileOperationFlag) ComResult[None]#
- set_ownerwindow(window_handle: int) None#
- set_progressmsg(msg: str) None#
- set_props(array: PropertyChangeArray) None#
- set_props_nothrow(array: PropertyChangeArray) ComResult[None]#
- unadvise(cookie: int) None#
- property wrapped_obj: c_void_p#
- class powcshell.shellfileop.ShellFileOperationFlag(*values)#
ベースクラス:
IntFlagFOF_*定数およびFOFX_*定数
- ADD_UNDO_RECORD = 536870912#
- ALLOW_UNDO = 64#
- CONFIRM_MOUSE = 2#
- COPY_AS_DOWNLOAD = 1073741824#
- DONT_DISPLAYS_OUR_CE_PATH = 67108864#
- DONT_DISPLAY_DEST_PATH = 134217728#
- DONT_DISPLAY_LOCATIONS = 2147483648#
- EARLY_FAILURE = 1048576#
- FILES_ONLY = 128#
- KEEP_NEWER_FILE = 4194304#
- MOVE_ACLS_ACROSS_VOLUMES = 33554432#
- MULTI_DEST_FILES = 1#
- NO_CONFIRMATION = 16#
- NO_CONFIRM_MKDIR = 512#
- NO_CONNECTED_ELEMENTS = 8192#
- NO_COPY_HOOKS = 8388608#
- NO_COPY_SECURITY_ATTRIBS = 2048#
- NO_ERROR_UI = 1024#
- NO_MINIMIZE_BOX = 16777216#
- NO_RECURSE_REPARSE = 32768#
- NO_RECURSION = 4096#
- NO_SKIP_JUNCTIONS = 65536#
- NO_UI = 1556#
- PREFER_HARD_LINK = 131072#
- PRESERVE_FILE_EXTENSIONS = 2097152#
- RECYCLE_ON_DELETE = 524288#
- RENAME_ON_COLLISION = 8#
- REQUIRE_ELEVATION = 268435456#
- SHOW_ELEVATION_PROMPT = 262144#
- SILENT = 4#
- SIMPLE_PROGRESS = 256#
- WANT_MAPPING_HANDLE = 32#
- WANT_NUKE_WARNING = 16384#
- class powcshell.shellfileop.ShellFileOperationProgressSinkBase#
ベースクラス:
objectShellFileOperationのコールバックベースクラス。 コールバックを作成する場合は継承クラスを作成して目的のメソッドを実装してください。 実装したメソッドでは成功時はcomtypes.hresult.S_OK (0)、失敗時はcomtypes.hresult.E_FAIL (0x80004005)等を返してください。
ユーティリティクラスとしてshellfileoputil以下に ShellFileOperationProgressSinkForCallやShellFileOperationProgressSinkForPrintがあります。
サンプル
>>> class ShellFileOperationProgressSinkDerivered(ShellFileOperationProgressSinkBase): >>> ...
- finish_operations(hr_result: int) int#
- post_copyitem(flags: TransferSourceFlag, item: ShellItem2, dest_folder: ShellItem2, newname: str, hr_copy: int, newly_created_item: ShellItem2) int#
- post_deleteitem(flags: TransferSourceFlag, item: ShellItem2, hr_delete: int, newly_created_item: ShellItem2) int#
- post_moveitem(flags: TransferSourceFlag, item: ShellItem2, dest_folder: ShellItem2, newname: str, hr_move: int, newly_created_item: ShellItem2) int#
- post_newitem(flags: TransferSourceFlag, dest_folder: ShellItem2, newname: str, templatename: str, file_attrs: int, hr_new: int, newly_created_item: ShellItem2) int#
- post_renameitem(flags: TransferSourceFlag, item: ShellItem2, newname: str, hr_rename: int, newly_created_item: ShellItem2) int#
- pre_copyitem(flags: TransferSourceFlag, item: ShellItem2, dest_folder: ShellItem2, newname: str) int#
- pre_deleteitem(flags: TransferSourceFlag, item: ShellItem2) int#
- pre_moveitem(flags: TransferSourceFlag, item: ShellItem2, dest_folder: ShellItem2, newname: str) int#
- pre_newitem(flags: TransferSourceFlag, item: ShellItem2, newname: str) int#
- pre_renameitem(flags: TransferSourceFlag, item: ShellItem2, newname: str) int#
- start_operations() int#
- update_progress(work_total: int, work_so_far: int) int#
- class powcshell.shellfileop.TransferSourceFlag(*values)#
ベースクラス:
IntFlagTRANSFER_SOURCE_FLAGS
- ALLOW_DECRYPTION = 4#
- COPY_CREATION_TIME = 16#
- COPY_HARD_LINK = 256#
- COPY_LOCALIZED_NAME = 512#
- COPY_WRITE_TIME = 32#
- DELETE_RECYCLE_IF_POSSIBLE = 128#
- FAIL_EXIST = 0#
- MOVE_AS_COPY_DELETE = 1024#
- NORMAL = 0#
- NO_SECURITY = 8#
- OVERWRITE_EXIST = 2#
- RENAME_EXIST = 1#
- SUSPEND_SHELLEVENTS = 2048#
- USE_FULL_ACCESS = 64#