Use re.DOTALL to also match newlines with .
authorW. Trevor King <wking@drexel.edu>
Thu, 1 Jul 2010 00:08:49 +0000 (20:08 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 1 Jul 2010 00:08:49 +0000 (20:08 -0400)
sitecore/alt_tags.py
sitecore/prof/import.py

index 11aa9d8ed689d3ffbd2b5a4d60bba8d39f3f1f64..df4a4f89eb404478b707eb49b91afc3d9319ba8d 100644 (file)
@@ -47,7 +47,8 @@ def add_headshot_alt_tags(s):
         except NoSuchElementException, e:
             s.logger.info("can't lock %s (already locked?), skipping" % raw_name)
             continue
-        alt_granddad,alt_tag = s.find_field(re.compile('.*Alt:.*'), 'Alt')
+        alt_granddad,alt_tag = s.find_field(
+            re.compile('.*Alt:.*', re.DOTALL), 'Alt')
         alt_tag.clear()
         alt_tag.send_keys(name)
         s.publish_section('Added alt tag for %s' % name)
index 9144b5e8e9e58315f3690e2974eb24c179115bf0..4c164f764e81f3e798cc6d3f7f78f76eed44e8bf 100644 (file)
@@ -38,25 +38,26 @@ class ProfessorAdder (object):
     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 -.*'),
+            'Degrees':re.compile('Degrees:.*', re.DOTALL),
+            'College':re.compile('College:.*', re.DOTALL),
+            'Program':re.compile('Program:.*', re.DOTALL),
+            'Office':re.compile('Office:.*', re.DOTALL),
+            'Specialization':re.compile('.*Specialization:.*', re.DOTALL),
+            'Research Interests':re.compile('.*Research Interests:.*',
+                                            re.DOTALL),
+            'Personal Site':re.compile('.*Personal Site:.*', re.DOTALL),
+            'Title':re.compile('.*Title:.*', re.DOTALL),
+            'First Name':re.compile('.*First Name:.*', re.DOTALL),
+            'Last Name':re.compile('.*Last Name:.*', re.DOTALL),
+            'Bio':re.compile('.*Bio:.*', re.DOTALL),
+            'Headshot':re.compile('.*Headshot:.*', re.DOTALL),
+            'Email':re.compile('.*Email:.*', re.DOTALL),
+            'Phone':re.compile('.*Phone:.*', re.DOTALL),
+            'Fax':re.compile('.*Fax:.*', re.DOTALL),
+            'Page Title':re.compile('.*Page Title -.*', re.DOTALL),
+            'Menu Title':re.compile('.*Menu Title -.*', re.DOTALL),
+            'Breadcrumb Title':re.compile('.*Breadcrumb Title -.*', re.DOTALL),
+            'See Also Title':re.compile('.*See Also title -.*', re.DOTALL),
             }
 
     def setup(self):