Content -> Home -> physics -> contact -> facultyDirectory
"""
+import re
import time
from selenium.common.exceptions import NoSuchElementException
"""
def __init__(self, sitecore_connection):
self.s = sitecore_connection
+ self.regexps = {
+ 'Degrees':re.compile('Degrees:.*'),
+ 'College':re.compile('College:.*'),
+ 'Program':re.compile('Program:.*'),
+ 'Office':re.compile('Office:.*'),
+ 'Specialization':re.compile('.*Specialization:.*'),
+ 'Research Interests':re.compile('.*Research Interests:.*'),
+ 'Personal Site':re.compile('.*Personal Site:.*'),
+ 'Title':re.compile('.*Title:.*'),
+ 'First Name':re.compile('.*First Name:.*'),
+ 'Last Name':re.compile('.*Last Name:.*'),
+ 'Bio':re.compile('.*Bio:.*'),
+ 'Headshot':re.compile('.*Headshot:.*'),
+ 'Email':re.compile('.*Email:.*'),
+ 'Phone':re.compile('.*Phone:.*'),
+ 'Fax':re.compile('.*Fax:.*'),
+ 'Page Title':re.compile('.*Page Title -.*'),
+ 'Menu Title':re.compile('.*Menu Title -.*'),
+ 'Breadcrumb Title':re.compile('.*Breadcrumb Title -.*'),
+ 'See Also Title':re.compile('.*See Also title -.*'),
+ }
def setup(self):
#self.s.expand_nav_section('sitecore')
self.create_prof_page(name)
self.lock_section(name)
settings = [
- ('Degrees:', prof.degrees()),
- ('College:', prof.colleges()),
- ('Program:', prof.program()),
- ('Office:', prof.contact.office),
- ('Specialization:', prof.bio.specialization),
- ('Research Interests:', ''),
- ('Personal Site:', prof.sites()),
- ('Title:', prof.title),
- ('First Name:', prof.name.first_middle),
- ('Last Name:', prof.name.last),
- ('Bio:', prof.profile()),
- ('Headshot:', ('/Images/physics/headshots/%s'
+ ('Degrees', prof.degrees()),
+ ('College', prof.colleges()),
+ ('Program', prof.program()),
+ ('Office', prof.contact.office),
+ ('Specialization', prof.bio.specialization),
+ ('Research Interests', ''),
+ ('Personal Site', prof.sites()),
+ ('Title', prof.title),
+ ('First Name', prof.name.first_middle),
+ ('Last Name', prof.name.last),
+ ('Bio', prof.profile()),
+ ('Headshot', ('/Images/physics/headshots/%s'
% name.lower().replace('.','').replace(' ','_'))),
- ('Email:', prof.contact.email),
- ('Phone:', prof.contact.phone),
- ('Fax:', prof.lab_contact()),
- ('Page Title -', name),
- ('Menu Title -', name),
- ('Breadcrumb Title -', name),
- ('See Also title -', name),
+ ('Email', prof.contact.email),
+ ('Phone', prof.contact.phone),
+ ('Fax', prof.lab_contact()),
+ ('Page Title', name),
+ ('Menu Title', name),
+ ('Breadcrumb Title', name),
+ ('See Also title', name),
]
for field_name,value in settings:
if value == None:
value = ''
- granddad,field = self.s.find_field(field_name)
+ granddad,field = self.s.find_field(self.regexps[field_name],
+ field_name)
try:
editor_link = granddad.find_element_by_link_text('Edit Html')
self.set_editor_field(editor_link, value)