Merge lp:~elopio/ubuntuone-testing/sst-contacts into lp:ubuntuone-testing

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 45
Merged at revision: 47
Proposed branch: lp:~elopio/ubuntuone-testing/sst-contacts
Merge into: lp:ubuntuone-testing
Diff against target: 739 lines (+707/-0)
6 files modified
ubuntuone/web/tests/sst/contacts/u1webc001_addcontact.py (+38/-0)
ubuntuone/web/tests/sst/contacts/u1webc002_editcontact.py (+46/-0)
ubuntuone/web/tests/sst/contacts/u1webc003_deletecontact.py (+42/-0)
ubuntuone/web/tests/sst/shared/actions/contacts.py (+346/-0)
ubuntuone/web/tests/sst/shared/actions/loading.py (+31/-0)
ubuntuone/web/tests/sst/shared/data/contact.py (+204/-0)
To merge this branch: bzr merge lp:~elopio/ubuntuone-testing/sst-contacts
Reviewer Review Type Date Requested Status
Rick McBride (community) Approve
Review via email: mp+79773@code.launchpad.net

Commit message

Added the actions and tests for contacts on the website (Fixes LP: #877934)

Description of the change

Added the actions and tests for contacts on the website (LP: #877934)

To post a comment you must log in.
Revision history for this message
Rick McBride (rmcbride) wrote :

Excellent!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'ubuntuone/web/tests/sst/contacts'
=== added file 'ubuntuone/web/tests/sst/contacts/u1webc001_addcontact.py'
--- ubuntuone/web/tests/sst/contacts/u1webc001_addcontact.py 1970-01-01 00:00:00 +0000
+++ ubuntuone/web/tests/sst/contacts/u1webc001_addcontact.py 2011-10-19 06:57:26 +0000
@@ -0,0 +1,38 @@
1# -*- coding: utf-8 -*-
2
3# Copyright 2011 Canonical Ltd.
4#
5# This program is free software: you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranties of
11# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12# PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program. If not, see <http://www.gnu.org/licenses/>.
16
17"""Test case u1webc-001 Add Contact.
18Add a contact to Ubuntu One through the website.
19
20"""
21
22import uuid
23from sst.actions import *
24import actions.setup as setup_actions
25import actions.contacts as contacts_actions
26from data.contact import Contact
27from data.contact import Name
28from data.contact import Email
29
30setup_actions.setup()
31contacts_actions.open()
32contact_uuid = uuid.uuid1()
33name = Name(first_name='Test first name %s' % contact_uuid,
34 last_name='Test last name %s' % contact_uuid)
35email = Email('Other', 'test-%s@example.com' % contact_uuid)
36contact = Contact(name, (email,))
37contacts_actions.add_contact(contact)
38contacts_actions.assert_contact_information(contact)
039
=== added file 'ubuntuone/web/tests/sst/contacts/u1webc002_editcontact.py'
--- ubuntuone/web/tests/sst/contacts/u1webc002_editcontact.py 1970-01-01 00:00:00 +0000
+++ ubuntuone/web/tests/sst/contacts/u1webc002_editcontact.py 2011-10-19 06:57:26 +0000
@@ -0,0 +1,46 @@
1# -*- coding: utf-8 -*-
2
3# Copyright 2011 Canonical Ltd.
4#
5# This program is free software: you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranties of
11# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12# PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program. If not, see <http://www.gnu.org/licenses/>.
16
17"""Test case u1webc-002 Edit Contact.
18Edit a contact stored on Ubuntu One through the website.
19
20"""
21
22import uuid
23from sst.actions import *
24import actions.setup as setup_actions
25import actions.contacts as contacts_actions
26from data.contact import Contact
27from data.contact import Name
28from data.contact import Email
29
30setup_actions.setup()
31contacts_actions.open()
32contact_uuid = uuid.uuid1()
33name = Name(first_name='Test first name %s' % contact_uuid,
34 last_name='Test last name %s' % contact_uuid)
35email = Email('Other', 'test-%s@example.com' % contact_uuid)
36contact = Contact(name, (email,))
37contacts_actions.add_contact(contact)
38contacts_actions.assert_contact_information(contact)
39edited_name = Name(first_name='Edited ' + name.first_name,
40 last_name='Edited ' + name.last_name)
41edited_email = Email(email.description, 'edited' + email.address)
42edited_contact = Contact(edited_name, (edited_email,))
43# This will also assert that the original email is not present in the list.
44# If it were, test will fail because two elements with the same id were found.
45contacts_actions.edit_contact(edited_contact)
46contacts_actions.assert_contact_information(edited_contact)
047
=== added file 'ubuntuone/web/tests/sst/contacts/u1webc003_deletecontact.py'
--- ubuntuone/web/tests/sst/contacts/u1webc003_deletecontact.py 1970-01-01 00:00:00 +0000
+++ ubuntuone/web/tests/sst/contacts/u1webc003_deletecontact.py 2011-10-19 06:57:26 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2
3# Copyright 2011 Canonical Ltd.
4#
5# This program is free software: you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranties of
11# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12# PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program. If not, see <http://www.gnu.org/licenses/>.
16
17"""Test case u1webc-003 Delete Contact.
18Delete a contact from Ubuntu One through the website.
19
20"""
21
22import uuid
23from sst.actions import *
24import actions.setup as setup_actions
25import actions.contacts as contacts_actions
26from data.contact import Contact
27from data.contact import Name
28from data.contact import Email
29
30setup_actions.setup()
31contacts_actions.open()
32contact_uuid = uuid.uuid1()
33name = Name(first_name='Test first name %s' % contact_uuid,
34 last_name='Test last name %s' % contact_uuid)
35email = Email('Other', 'test-%s@example.com' % contact_uuid)
36contact = Contact(name, (email,))
37contacts_actions.add_contact(contact)
38contacts_actions.assert_contact_information(contact)
39contact_identifier = contacts_actions.get_contact_identifier()
40contacts_actions.assert_contact_exists(contact_identifier)
41contacts_actions.delete_contact()
42fails(contacts_actions.assert_contact_exists, contact_identifier)
043
=== added file 'ubuntuone/web/tests/sst/shared/actions/contacts.py'
--- ubuntuone/web/tests/sst/shared/actions/contacts.py 1970-01-01 00:00:00 +0000
+++ ubuntuone/web/tests/sst/shared/actions/contacts.py 2011-10-19 06:57:26 +0000
@@ -0,0 +1,346 @@
1# -*- coding: utf-8 -*-
2
3# Copyright 2011 Canonical Ltd.
4#
5# This program is free software: you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranties of
11# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12# PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program. If not, see <http://www.gnu.org/licenses/>.
16
17"""Actions for the Contacts page of the Ubuntu One website."""
18
19from sst.actions import *
20from loading import *
21from data.contact import Contact
22
23def open():
24 """Open the Contacts page and assert it's title."""
25 goto('/contacts/')
26 assert_title()
27
28def assert_title():
29 """Assert that the title of the page is the expected."""
30 title_is(u'Ubuntu One : Contacts')
31
32def add_contact(contact):
33 """Add a new contact.
34
35 Keyword arguments:
36 contact -- The contact that will be added.
37
38 """
39 link_add = get_element(css_class='add-button')
40 link_click(link_add)
41 wait_for_action_to_complete()
42 _fill_contact(contact)
43 link_save = get_elements(css_class='save-button')[0]
44 element_click(link_save)
45 wait_for_action_to_complete()
46
47def edit_contact(edited_contact):
48 """Edit the information of the opened contact.
49
50 Keyword arguments:
51 edited_contact -- The contact with the edited information.
52
53 """
54 link_edit = get_element(css_class='edit-button')
55 element_click(link_edit)
56 wait_for_action_to_complete()
57 _fill_contact(edited_contact)
58 link_save = get_elements(css_class='save-button')[0]
59 element_click(link_save)
60 wait_for_action_to_complete()
61
62def _fill_contact(contact):
63 """Fill the contact information.
64
65 Keyword arguments:
66 contact -- The contact with the information that will be filled.
67
68 """
69 if contact.name:
70 _fill_contact_name(contact.name)
71 _fill_contact_emails(contact.emails)
72 _fill_contact_phones(contact.phones)
73 _fill_contact_addresses(contact.addresses)
74 _fill_contact_instant_messaging_addresses(
75 contact.instant_messaging_addresses)
76 _fill_contact_urls(contact.urls)
77 if contact.role:
78 _fill_contact_role(contact.role)
79 if contact.about_information:
80 _fill_contact_about_information(contact.about_information)
81
82def _fill_contact_name(name):
83 """Fill the contact name information.
84
85 Keyword arguments:
86 name -- The name of the contact.
87
88 """
89 if name.title:
90 textfield_write('names-title', name.title)
91 if name.first_name:
92 textfield_write('names-first_name', name.first_name)
93 if name.middle_name:
94 textfield_write('names-middle_name', name.middle_name)
95 if name.last_name:
96 textfield_write('names-last_name', name.last_name)
97 if name.suffix:
98 textfield_write('names-suffix', name.suffix)
99
100def _fill_contact_emails(emails):
101 """Fill the contact emails information.
102
103 Keyword arguments:
104 emails -- A sequence with the emails of the contact.
105
106 """
107 for index, email in enumerate(emails):
108 set_select('%d-email_addresses-description' % index,
109 email.description)
110 textfield_write('%d-email_addresses-address' % index, email.address)
111 element_click('add-email-address')
112
113def _fill_contact_phones(phones):
114 """Fill the contact phones information.
115
116 Keyword arguments:
117 phones -- A sequence with the phones of the contact.
118
119 """
120 for index, phone in enumerate(phones):
121 set_select('%d-phone_numbers-description' % index, phone.description)
122 textfield_write('%d-phone_numbers-number' % index, phone.number)
123 element_click('add-phone-number')
124
125def _fill_contact_addresses(addresses):
126 """Fill the contact addresses information.
127
128 Keyword arguments:
129 addresses -- A sequence with the addresses of the contact.
130
131 """
132 for index, address in enumerate(addresses):
133 set_select('%d-addresses-description' % index, address.description)
134 textfield_write('%d-addresses-address1' % index, address.address1)
135 textfield_write('%d-addresses-address2' % index, address.address2)
136 textfield_write('%d-addresses-pobox' % index, address.po_box)
137 textfield_write('%d-addresses-city' % index, address.city)
138 textfield_write('%d-addresses-state' % index, address.state)
139 textfield_write('%d-addresses-postalcode' % index, address.postal_code)
140 textfield_write('%d-addresses-country' % index, address.country)
141 element_click('add-postal-address')
142
143def _fill_contact_instant_messaging_addresses(instant_messaging_addresses):
144 """Fill the contact instant messaging information.
145
146 Keyword arguments:
147 instant_messaging_addresses -- A sequence of instant messaging addresses.
148
149 """
150 for index, address in enumerate(instant_messaging_addresses):
151 set_select('%d-im_addresses-description' % index, address.description)
152 textfield_write('%d-im_addresses-address' % index, address.address)
153 element_click('add-im-address')
154
155def _fill_contact_urls(urls):
156 """Fill the contact URLs information.
157
158 Keyword arguments:
159 urls -- A sequence with the URLs of the contact.
160
161 """
162 for index, url in enumerate(urls):
163 textfield_write('%d-urls-description' % index, url.description)
164 textfield_write('%d--urls-address' % index, url.url)
165 element_click('add-url')
166
167def _fill_contact_role(role):
168 """Fill the contact role information.
169
170 Keyword arguments:
171 role -- The job role information of the contact.
172
173 """
174 if role.company:
175 textfield_write('work-company', role.company)
176 if role.department:
177 textfield_write('work-department', role.department)
178 if role.job_title:
179 textfield_write('work-job_title', role.job_title)
180 if role.manager_name:
181 textfield_write('work-manager_name', role.manager_name)
182 if role.assitant_name:
183 textfield_write('work-assistant_name', role.assistant_name)
184
185def _fill_contact_about_information(about_information):
186 """Fill the additional information about the contact.
187
188 Keyword arguments:
189 about_information -- The additional information about the contact.
190
191 """
192 if about_information.nickname:
193 textfield_write('personal-nick_name', about_information.nickname)
194 if about_information.birth_date:
195 textfield_write('personal-birth_date', about_information.birth_date)
196 if about_information.spouse_name:
197 textfield_write('personal-spouse_name', about_information.spouse_name)
198 if about_information.wedding_date:
199 textfield_write('personal-wedding_date',
200 about_information.wedding_date)
201 if about_information.notes:
202 textfield_write('personal-notes', about_information.notes)
203
204def assert_contact_information(contact):
205 """Assert that the information of the displayed contact is the expected.
206
207 Keyword arguments:
208 contact -- The expected contact information.
209
210 """
211 _assert_contact_name(contact.name)
212 _assert_contact_emails(contact.emails)
213 contact_identifier = get_contact_identifier()
214 _assert_contact_in_list(contact_identifier, contact)
215 # TODO _assert_contact_phones(contact.phones)
216 # TODO _assert_contact_addresses(contact.addresses)
217 # TODO _assert_contact_instant_messaging_addresses(
218 # contact.instant_messaging_addresses)
219 # TODO _assert_contact_urls(contact.urls)
220 # TODO _assert_contact_role(contact.role)
221 # TODO _assert_contact_about_information(contact.about_information)
222
223def get_contact_identifier():
224 """Get the identifier of the opened contact."""
225 button_edit = get_element_by_css('.edit-button')
226 return button_edit.get_attribute('id')
227
228def _get_element_contact_record(identifier):
229 """Get the contact record element from the contacts list.
230
231 Keyword arguments:
232 identifier -- The identifier of the contact.
233
234 """
235 return get_element(id=identifier, css_class='contact-record')
236
237def _assert_contact_in_list(contact_identifier, contact_information):
238 """Assert that the contact appears on the right place on the contacts list.
239
240 Keyword arguments:
241 contact_identifier -- The identifier of the contact.
242 contact_information -- The expected contact information.
243
244 """
245 # TODO to assert that the contact is under the right letter we need it to
246 # have separate divs for each letter.
247 # first_letter = _get_contact_letter_in_list(contact.name)
248 display_name = _get_contact_display_name_in_list(contact_information.name)
249 element_contact = _get_element_contact_record(contact_identifier)
250 element_name = element_contact.find_element_by_css_selector('.name a')
251 text_is(element_name, display_name)
252 if contact_information.emails:
253 element_email = element_contact.find_element_by_css_selector('.email')
254 text_is(element_email, contact_information.emails[0].address)
255
256def _get_contact_display_name_in_list(name):
257 """Get the expected name to display in the contacts list.
258
259 Keyword arguments:
260 name -- The name information of the contact.
261
262 """
263 if name and (name.last_name or name.first_name):
264 names = []
265 if name.last_name:
266 names.append(name.last_name)
267 if name.first_name:
268 names.append(name.first_name)
269 display_name = ', '.join(names)
270 else:
271 display_name = 'New contact'
272 return display_name
273
274def _get_contact_letter_in_list(name):
275 """Get the letter under which it's expected to find the contact in the
276 list.
277
278 Keyword arguments:
279 name -- The name information of the contact.
280
281 """
282 if name and (name.last_name or name.first_name):
283 if name.last_name:
284 first_letter = name.last_name[0]
285 else:
286 first_letter = name.first_name[0]
287 else:
288 first_letter = '0' # TODO ask if this is the correct behavior.
289
290def _assert_contact_name(name):
291 """Assert that the name of the displayed contact is the expected.
292
293 Keyword arguments:
294 name -- The name information of the contact.
295
296 """
297 if not name:
298 display_name = 'New contact'
299 else:
300 names = []
301 if name.title:
302 names.append(name.title)
303 if name.first_name:
304 names.append(name.first_name)
305 if name.middle_name:
306 names.append(name.middle_name)
307 if name.last_name:
308 names.append(name.last_name)
309 if name.suffix:
310 names.append(name.suffix)
311 display_name = ' '.join(names)
312 label = get_element_by_css('#names>h1')
313 text_is(label, display_name)
314
315def _assert_contact_emails(emails):
316 """Assert that the email addresses of the displayed contact are the
317 expected.
318
319 Keyword arguments:
320 emails -- A sequence with the expected email addresses.
321
322 """
323 elements_email_descriptions = get_elements_by_css('#email_addresses dt')
324 elements_email_addresses = get_elements_by_css('#email_addresses a')
325 for index, email in enumerate(emails):
326 text_is(elements_email_descriptions[index], '%s:' % email.description)
327 text_is(elements_email_addresses[index], email.address)
328
329def delete_contact():
330 """Delete the opened contact."""
331 contact_identifier = get_contact_identifier()
332 element_contact = _get_element_contact_record(contact_identifier)
333 element_contact_checkbox = element_contact. \
334 find_element_by_css_selector('.contact-delete-checkbox')
335 checkbox_set(element_contact_checkbox, True)
336 element_click('delete-selected')
337 alert_accept('Delete selected contacts?')
338 wait_for_action_to_complete()
339
340def assert_contact_exists(identifier):
341 """Assert that a contact exists.
342
343 Keyword arguments:
344 identifier -- The identifier of the contact.
345 """
346 _get_element_contact_record(identifier)
0347
=== added file 'ubuntuone/web/tests/sst/shared/actions/loading.py'
--- ubuntuone/web/tests/sst/shared/actions/loading.py 1970-01-01 00:00:00 +0000
+++ ubuntuone/web/tests/sst/shared/actions/loading.py 2011-10-19 06:57:26 +0000
@@ -0,0 +1,31 @@
1# -*- coding: utf-8 -*-
2
3# Copyright 2011 Canonical Ltd.
4#
5# This program is free software: you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranties of
11# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12# PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program. If not, see <http://www.gnu.org/licenses/>.
16
17"""Actions to wait for data loading to complete."""
18
19from sst.actions import *
20
21def wait_for_action_to_complete():
22 """Wait for the last action to complete.
23
24 This function waits for the waiting bar to disappear.
25
26 """
27 # Added a little sleep because if this function is called to fast before
28 # the bar appears tests will fail.
29 sleep(3)
30 waiting_bar = get_element(css_class='yui3-busy-waiting')
31 waitfor(fails, is_displayed, waiting_bar)
032
=== added directory 'ubuntuone/web/tests/sst/shared/data'
=== added file 'ubuntuone/web/tests/sst/shared/data/__init__.py'
=== added file 'ubuntuone/web/tests/sst/shared/data/contact.py'
--- ubuntuone/web/tests/sst/shared/data/contact.py 1970-01-01 00:00:00 +0000
+++ ubuntuone/web/tests/sst/shared/data/contact.py 2011-10-19 06:57:26 +0000
@@ -0,0 +1,204 @@
1# -*- coding: utf-8 -*-
2
3# Copyright 2011 Canonical Ltd.
4#
5# This program is free software: you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranties of
11# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12# PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program. If not, see <http://www.gnu.org/licenses/>.
16
17"""Data classes for a Contact."""
18
19class Contact:
20 "Class for Contact information."
21
22 def __init__(self, name=None, emails=(), phones=(), addresses=(),
23 instant_messaging_addresses=(), urls=(), role=None,
24 about_information=None):
25 """Class constructor.
26
27 Keyword arguments:
28 name -- The name of the contact. Default is None.
29 emails -- A sequence with the emails of the contact. Default is an
30 empty tuple.
31 phones -- A sequence with the phones of the contact. Default is an
32 empty tuple.
33 addresses -- A sequence with the addresses of the contac. Default is
34 an empty tuple.
35 instant_messaging_addresses -- A sequence with the instant messaging
36 addresses of the contact. Default is an empty tuple.
37 urls -- A sequence with the URLs of the contact. Default is an empty
38 tuple.
39 role -- The job role of the contact. Default is None.
40 about_information -- Additional information of the contact. Default is
41 None.
42
43 """
44 self.name = name
45 self.emails = emails
46 self.phones = phones
47 self.addresses = addresses
48 self.instant_messaging_addresses = instant_messaging_addresses
49 self.urls = urls
50 self.role = role
51 self.about_information = about_information
52
53class Name:
54 """Class for the name of a contact."""
55
56 def __init__(self, title=None, first_name=None, middle_name=None,
57 last_name=None, suffix=None):
58 """Class constructor.
59
60 Keyword arguments:
61 title -- The title of the contact. Default is None.
62 first_name -- The first name of the contact. Default is None.
63 middle_name -- The middle name of the contact. Default is None.
64 last_name -- The last name of the contact. Default is None.
65 suffix -- The suffix of the contact. Default is None.
66
67 """
68 self.title = title
69 self.first_name = first_name
70 self.middle_name = middle_name
71 self.last_name = last_name
72 self.suffix = suffix
73
74class Email:
75 """Class for the email of a contact."""
76
77 def __init__(self, description, address):
78 """Class constructor.
79
80 Keyword arguments:
81 description -- The description of the email. It can be 'Other',
82 'Home' or Work.
83 address -- The email address.
84
85 """
86 self.description = description
87 self.address = address
88
89class Phone:
90 """Class for the phone of a contact."""
91
92 def __init__(self, description, number):
93 """Class constructor.
94
95 Keyword arguments:
96 description -- The description of the phone. It can be 'Home',
97 'Mobile', 'Home fax', 'Work', 'Car', 'Pager', 'Work fax',
98 'Assitant', 'Call back', 'Company', 'Other fax', 'Primary',
99 'Telex' or 'Other'.
100 number -- The phone number.
101
102 """
103 self.description = description
104 self.number = number
105
106class Address:
107 """Class for the address of a contact."""
108
109 def __init__(self, description, address1=None, address2=None, po_box=None,
110 city=None, state=None, postal_code=None, country=None):
111 """Class constructor.
112
113 Keyword arguments:
114 description -- The description of the address. It can be 'Home',
115 'Work' or 'Other'.
116 address1 -- The first line of the address. Default is None.
117 address2 -- The second line of the address. Default is None.
118 po_box -- The post office box number. Default is None.
119 city -- The name of the city. Default is None.
120 state -- The name of the state. Default is None.
121 postal_code -- The postal code number. Default is None.
122 country -- The name of the country. Default is None.
123
124 """
125 self.description = description
126 self.address1 = address1
127 self.address2 = address2
128 self.po_box = po_box
129 self.city = city
130 self.state = state
131 self.postal_code = postal_code
132 self.country = country
133
134class InstantMessagingAddress:
135 """Class for the Instant Messaging address of a contact."""
136
137 def __init__(self, description, address):
138 """Class constructor.
139
140 Keyword arguments:
141 description -- The description of the instan messaging address. It can
142 be 'AIM', 'Gadu-Gadu', 'GroupWise', 'ICQ', 'IRC', 'Jabber', 'MSN',
143 'Skype', 'Yahoo', or 'Other'.
144 address -- The instant messaging address.
145
146 """
147 self.description = description
148 self.address = address
149
150class Url:
151 """Class for the Universal Resource Locators of a contact."""
152
153 def __init__(self, description, url):
154 """Class constructor.
155
156 Keyword arguments:
157 description -- The description of the URL.
158 url -- The Universal Resource Locator.
159
160 """
161 self.description = description
162 self.url = url
163
164class Role:
165 """Class for the role of a contact."""
166
167 def __init__(self, company=None, department=None, job_title=None,
168 manager_name=None, assistant_name=None):
169 """Class constructor.
170
171 Keyword arguments:
172 company -- The name of the company. Default is None.
173 department -- The name of the department. Default is None.
174 job_title -- The name of the job possition. Default is None.
175 manager_name -- The name of the manager. Default is None.
176 assitant_name -- The name of the assistant. Default is None.
177
178 """
179 self.company = company
180 self.department = department
181 self.job_title = job_title
182 self.manager_name = manager_name
183 self.assitant_name = assitant_name
184
185class AboutInformation:
186 """Class for additional information about the contact."""
187
188 def __init__(self, nickname=None, birth_date=None, spouse_name=None,
189 wedding_date=None, notes=None):
190 """Class constructor.
191
192 Keyword arguments:
193 nickname -- The nickname. Default is None.
194 birth_date -- The date of birth. Default is None.
195 spouse_name -- The name of the spouse. Default is None.
196 wedding_date -- The date of the wedding. Default is None.
197 notes -- Additional notes about the contact. Default is None.
198
199 """
200 self.nickname = nickname
201 self.birth_date = birth_date
202 self.spouse_name = spouse_name
203 self.wedding_date = wedding_date
204 self.notes = notes

Subscribers

People subscribed via source and target branches