Lines Matching full:existing
9 characters, and clashes with existing files.
32 def userNameToFileName(userName, existing=[], prefix="", suffix=""): argument
36 upper- and lower-case characters, and clashes with existing files.
40 existing: A case-insensitive list of all existing file names.
130 if fullName.lower() in existing:
131 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)
193 def handleClash2(existing=[], prefix="", suffix=""): argument
195 existing should be a case-insensitive list
196 of all existing file names.
200 >>> existing = [prefix + str(i) + suffix for i in range(100)]
202 >>> e = list(existing)
203 >>> handleClash2(existing=e, prefix=prefix, suffix=suffix) == (
207 >>> e = list(existing)
209 >>> handleClash2(existing=e, prefix=prefix, suffix=suffix) == (
213 >>> e = list(existing)
215 >>> handleClash2(existing=e, prefix=prefix, suffix=suffix) == (
227 if fullName.lower() not in existing: