| 2252 | return sValue or u'' |
| 2253 | |
| 2254 | def processSingleURI(sProperty): |
| 2255 | sValue = self.getPropertyValue(elmCard, sProperty, self.URI) |
| 2256 | if sValue: |
| 2257 | sContentType = '' |
| 2258 | sEncoding = '' |
| 2259 | sValueKey = '' |
| 2260 | if sValue.startswith('data:'): |
| 2261 | sEncoding = ';ENCODING=b' |
| 2262 | sContentType = sValue.split(';')[0].split('/').pop() |
| 2263 | sValue = sValue.split(',', 1).pop() |
| 2264 | else: |
| 2265 | elmValue = self.getPropertyValue(elmCard, sProperty) |
| 2266 | if elmValue: |
| 2267 | if sProperty != 'url': |
| 2268 | sValueKey = ';VALUE=uri' |
| 2269 | sContentType = elmValue.get('type', '').strip().split('/').pop().strip() |
| 2270 | sContentType = sContentType.upper() |
| 2271 | if sContentType == 'OCTET-STREAM': |
| 2272 | sContentType = '' |
| 2273 | if sContentType: |
| 2274 | sContentType = ';TYPE=' + sContentType.upper() |
| 2275 | arLines.append(self.vcardFold(sProperty.upper() + sEncoding + sContentType + sValueKey + ':' + sValue)) |
| 2276 | |
| 2277 | def processTypeValue(sProperty, arDefaultType, arForceType=None): |
| 2278 | arResults = self.getPropertyValue(elmCard, sProperty, bAllowMultiple=1) |