omz / Pythonista-Issues

Issue tracker for Pythonista (iOS)
169 stars 14 forks source link

Constant contacts.MOBILE_PHONE missing from `contacts` module #330

Open Dutcho opened 7 years ago

Dutcho commented 7 years ago

While contacts.IPHONE exists in Pythonista's iOS-specific module contacts, the (brand-agnostic) contacts.MOBILE_PHONE does not, even though "_$!<Mobile>!$_" is recognized by contacts.localized_label() and the constant is mentioned in Apple's documentation. This applies consistently to the documentation.

Not a big issue, just an omission. Latest beta, latest iOS.

Phuket2 commented 7 years ago

@Dutcho, not sure if this is helpful or not. But I playing around with contacts.Person. Was using faker to fill in contacts.Person() attrs. obj.phone = [('Work', fake.phone_number())] Is what i had to do for phone. A list of tuples(label, str). Address for example is a list of tuples(label, dict). Anyway, if its not help just ignore

Dutcho commented 7 years ago

Thanks @Phuket2 Indeed the contacts.Person data structure with its multi-strings/-dictionaries needs some getting used to.

BTW, I think the preferred way to label e.g. a phone number is the label constants, so obj.phone = [(contacts.WORK, fake.phone_number())] in your snippet. The literal 'Work' will work, but the constant contacts.WORK enables localization (via contacts.localized_label() and in the Contacts iOS App) by using some specific marker chars (like in '_$!<Mobile>!$_' in original post). If you don't need that, it doesn't really matter, I guess.