Ë
    Î£j0  ã                   óŽ   — d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
  e j                  «       Zdedz  fd„Zdedz  fd„Zy)	é    N)ÚPath)Úconfig)Úload_particle_system_map)ÚcopyÚdeleteÚreturnc            	      ó  ‡
— 	 t        t        j                  d¬«       t        j                  dz  } t        j                  }| j                  dd¬«       |j                  dd¬«       | j                  d«      D ]%  }t        j                  |||j                  z  «       Œ' 	 t        j                  }	 t        |«      }|j!                  «       D �ch c]  }t#        |«      j                  ’Œ }}t        j                  Š
t%        ˆ
fd„|D «       «      }|sy	t'        |«      t'        |«      k(  rd‰
› d�S dj)                  |d	d «      }	t'        |«      dkD  r|	dt'        |«      dz
  › d�z  }	dt'        |«      › dt'        |«      › d‰
› d|	› d�	S # t        $ r5}t        j                  d«       d|› dt        j                  › �cY d	}~S d	}~ww xY w# t        $ r(}t        j                  d
«       d|› d|› d�cY d	}~S d	}~ww xY wc c}w )zÔPopulate the temp staging folder with vanilla PCFs from backup_dir/particles,
    then verify all expected files landed. Returns a user-facing error message on
    failure, or None if the staging folder is ready.T)Únot_exist_okÚ	particles)ÚparentsÚexist_okz*.pcfzError preparing working copyz-Failed to populate the temp staging folder.

z

See the log for details:
Nz'Failed to load particle_system_map.jsonz5Could not read the bundled particle_system_map.json:
ú

zq

The preloader install appears to be incomplete or corrupted, try re-extracting the preloader to a local folder.c              3   óJ   •K  — | ]  }‰|z  j                  «       rŒ|–— Œ y ­w)N)Úexists)Ú.0ÚnameÚdests     €úFC:\Users\pivot\Documents\cueki\casual-preloader\core\backup_manager.pyÚ	<genexpr>z'prepare_working_copy.<locals>.<genexpr>1   s!   øè ø€ ÐM¡h˜d°t¸d±{×6JÑ6JÕ6L”T¡hùs   ƒ#œ#z*Vanilla particle staging folder is empty:
a.  

None of the vanilla .pcf files that ship with the preloader were copied into this folder. Try restarting the preloader. If the problem persists, the install may be incomplete or corrupted (antivirus, OneDrive sync, or a bad download can cause this), try re-extracting the preloader to a local folder.z, é   z, and z morez+Vanilla particle staging folder is missing z of z expected files:
z

Missing: z 

The bundled backup/ folder may be incomplete, or some files were blocked by antivirus or filesystem issues. Try re-extracting the preloader to a local folder.)r   r   Útemp_dirÚ
backup_dirÚtemp_to_be_referenced_dirÚmkdirÚglobÚshutilÚcopy2r   Ú	ExceptionÚlogÚ	exceptionÚlog_fileÚparticle_system_map_filer   Úkeysr   ÚsortedÚlenÚjoin)Úbackup_particles_dirÚparticle_dest_dirÚpcf_fileÚeÚmap_pathÚparticle_mapÚkeyÚexpectedÚmissingÚpreviewr   s             @r   Úprepare_working_copyr1      s  ø€ ð

ÜŒv�‰¨TÕ2ä%×0Ñ0°;Ñ>ÐÜ"×<Ñ<ÐØ×"Ñ"¨4¸$Ð"Ô?Ø×Ñ¨°tÐÔ<à,×1Ñ1°'Ö:ˆHÜ�L‰L˜Ð#4°x·}±}Ñ#DÕEñ ;ô ×.Ñ.€Hð	
Ü/°Ó9ˆð +7×*;Ñ*;Ô*=Ó>Ñ*= 3”�S“	—“Ð*=€HÐ>Ü×+Ñ+€DÜÓM¡hÓMÓM€GáØä
ˆ7ƒ|”s˜8“}Ò$à9¸$¸ð @Að Að	
ð �i‰i˜  ˜Ó$€GÜ
ˆ7ƒ|�aÒØ�VœC ›L¨1Ñ,Ð-¨UÐ3Ñ3ˆà
5´c¸'³l°^À4Üˆx‹=ˆ/Ð+¨D¨6ð 2Ø�9ð 'ð	'ðøôQ ò 
Ü�‰Ð4Ô5à=Øˆcð )Ü)/¯©Ð(9ð;õ	
ûð
ûô ò 
Ü�‰Ð?Ô@àDÀXÀJÈdØˆcð AðAõ	
ûð
üò ?sB   ƒBF	 Â2G
 ÃG>Æ		GÆ*GÆ<GÇGÇ
	G;ÇG6Ç0G;Ç6G;c                  óî   — t         j                  dz  } t         j                  dz  }	 t        | |d¬«       t        «       S # t        $ r+}t
        j                  d«       d| › d|› d|› d�cY d	}~S d	}~ww xY w)
z‘Run all startup setup steps that populate the staging folder. Returns a
    user-facing error message on failure, or None if everything is ready.ÚbackupF)Ú	noclobberz-Failed to copy bundled backup/ to project dirz4Failed to copy the bundled backup/ folder.

Source: z
Destination: r   zã

This usually means the application can't read its bundled files or can't write to its data folder. Try running the preloader from a local folder (not OneDrive/cloud-synced) and check that antivirus software isn't interfering.N)r   Úinstall_dirÚproject_dirr   r   r   r    r1   )Úbundled_backupÚproject_backupr*   s      r   Úprepare_runtime_environmentr9   M   s‹   € ô ×'Ñ'¨(Ñ2€NÜ×'Ñ'¨(Ñ2€Nð
Üˆ^˜^°uÕ=ô  Ó!Ð!øô ò 
Ü�‰ÐEÔFðØ%Ð&ð 'Ø*Ð+¨4Øˆcð *ð*õ		
ûð
ús   ¨A  Á 	A4Á	 A/Á)A4Á/A4)Úloggingr   Úpathlibr   Úcore.configr   Úcore.operations.pcf_rebuildr   Úcore.util.filer   r   Ú	getLoggerr   Ústrr1   r9   © ó    r   Ú<module>rC      sH   ðÛ Û Ý å Ý @ß 'à€g×ÑÓ€ð>˜c D™jó >ðB" S¨4¡Zô "rB   