a „oe ã@s¸dZddlZddlZddlZddlmZmZej ej ¡dZ e de ƒe  e d¡dZ e e dejej¡Ze dej¡Ze ej¡Ze ¡dZe e¡Zdd „Zej e ed¡dS) zÓ Demonstrates how to propagate a folder's view state to all its subfolders The format of the ColInfo stream is apparently undocumented, but it can be read raw from one folder and copied to another's view state. éN)ÚshellÚshellconzTemplate folder:ÚShellÚColInfoéc Cs¨|D]ž}tj ||¡}tj |¡rt|ƒt |d¡d}t |dtj t j ¡}|  dt ¡| dt j¡}| t j¡}|  t¡d}dD]} |  | t | ¡¡q†d}qdS)Nrrr) ZAddressZButtonsZColZVidZWFlagsZFFlagsZSortZSortDirZShowCmdZ FolderTypeZModeZRev)ÚosÚpathÚjoinÚisdirÚprintrÚSHILCreateFromPathÚSHGetViewStatePropertyBagrÚSHGVSPB_FOLDERNODEFAULTSÚ pythoncomÚIID_IPropertyBagZWriteÚtemplate_streamÚReadÚ VT_UNKNOWNÚQueryInterfaceÚ IID_IStreamÚtemplate_colinfoÚ template_pb) Znot_usedZdir_nameÚfnamesÚfnameZ full_fnameZpidlZpbZiunkÚsÚattr©rúBC:\Program Files\Certbot\pkgs\win32comext\shell\demos\viewstate.pyÚupdate_colinfos& ü   r)Ú__doc__rÚsysrZwin32com.shellrrrÚsplitÚ executableZtemplate_folderr r Z template_pidlr rrrrrZ template_iunkrrrZStatZ streamsizerrÚwalkrrrrÚs& ü    %