Lines Matching full:existing
9 characters, and clashes with existing files.
33 def userNameToFileName(userName, existing=[], prefix="", suffix=""): argument
37 upper- and lower-case characters, and clashes with existing files.
41 existing: A case-insensitive list of all existing file names.
131 if fullName.lower() in existing:
132 fullName = handleClash1(userName, existing, prefix, suffix)
136 def handleClash1(userName, existing=[], prefix="", suffix=""): argument
138 existing should be a case-insensitive list
139 of all existing file names.
143 >>> existing = ["a" * 5]
145 >>> e = list(existing)
146 >>> handleClash1(userName="A" * 5, existing=e,
151 >>> e = list(existing)
153 >>> handleClash1(userName="A" * 5, existing=e,
158 >>> e = list(existing)
160 >>> handleClash1(userName="A" * 5, existing=e,
179 if fullName.lower() not in existing:
188 finalName = handleClash2(existing, prefix, suffix)
192 def handleClash2(existing=[], prefix="", suffix=""): argument
194 existing should be a case-insensitive list
195 of all existing file names.
199 >>> existing = [prefix + str(i) + suffix for i in range(100)]
201 >>> e = list(existing)
202 >>> handleClash2(existing=e, prefix=prefix, suffix=suffix) == (
206 >>> e = list(existing)
208 >>> handleClash2(existing=e, prefix=prefix, suffix=suffix) == (
212 >>> e = list(existing)
214 >>> handleClash2(existing=e, prefix=prefix, suffix=suffix) == (
226 if fullName.lower() not in existing: