
    W'Fg                          S SK r S r  SS jrg)    Nc                 b    SnUb   U " U5      b  SnU$ U$ ! [         R                   a     U$ f = f)z
Run the passed collision function with val as the only argument:
If libvirtError is raised, return False
If no libvirtError raised, return True
FT)libvirtlibvirtError)collision_cbvalchecks      0/usr/share/virt-manager/virtinst/generatename.pycheck_libvirt_collisionr
      sM     E
	C , L5L ## 	L	s    ..c                     [        U 5      n [        [        X3S-   5      5      nU(       d  S/U-   nSnU H&  nU n	Ub	  U	SXH4-  -  n	X-  n	U" U	5      (       a  M$  U	n  O   U(       d   eU$ )a	  
Generate a new name from the passed base string, verifying it doesn't
collide with the collision callback.

This can be used to generate disk path names from the parent VM or pool
name. Names generated look like 'base-#suffix', ex:

If foobar, and foobar-1.img already exist, and:
base   = "foobar"
suffix = ".img"

output = "foobar-2.img"

:param base: The base string to use for the name (e.g. "my-orig-vm-clone")
:param collision_cb: A callback function to check for collision,
    receives the generated name as its only arg
:param start_num: The number to start at for generating non colliding names
:param sep: The separator to use between the basename and the
    generated number (default is "-")
:param force_num: Force the generated name to always end with a number
i Nz%s%d)strlistrange)
baser   suffix	start_numsep	force_numnumrangeretitrynames
             r	   generate_namer      s    . t9DE)%789H6H$
C=#)*GG$$C  J3J    )    -F)r   r
   r    r   r	   <module>r      s      .027)r   