Also moved doc/faculty.txt into the sitecore.prof doctring.
+++ /dev/null
-Sitecore Faculty Profile Corresponding Information
-
-Faculty Information
--------------------
-Degrees* Degrees Earned (i.e. Dr., PhD)
-College* University Graduated From
-Program Area Within Department (i.e. Anthropology)
-Office* Office Location
-Office Hours (If applicable)
-Specialization* Research Areas/Specialization
-Publications Publications Listing (If applicable)
-Professional Society (If applicable)
-Academic Distinctions (If applicable)
-Research Interests (Please use "Specialization" Field)
-Personal Site Website Address (If applicable)
-
-Personal Profile
-----------------
-Title* Professional Title (i.e. Director of Publication Management)
-First Name* First Name / Middle Name
-Last Name* Last Name
-Bio Brief Bio/Profile/Blurb
-Short Bio Presentations (If applicable)
-Headshot* Photograph – Size should be width: 125px height: 150px
-Email* Email
-Phone* Phone # ‐ Please use this format: (111) 111‐1111
-Fax Lab Name, Lab Phone (If applicable, please use "Lab Name, Lab Phone" format)
-CV Resume
-
-* field required.
-
-If a basic text field (a field with no "editor") has more than one
-item in it then separate the items with a comma. For example: If a
-faculty member has more than one title, then list their titles like
-this: Professor of Communication, Director of Publication Management,
-Yearbook Advisor, etc.
--- /dev/null
+#!/usr/bin/env python
+# Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
+#
+# This file is part of SiteCorePy.
+#
+# SiteCorePy is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 2 of the License, or (at your
+# option) any later version.
+#
+# SiteCorePy is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with SiteCorePy. If not, see <http://www.gnu.org/licenses/>.
+
+"""
+Sitecore Faculty Profile Corresponding Information
+
+Faculty Information
+-------------------
+Degrees* Degrees Earned (i.e. Dr., PhD)
+College* University Graduated From
+Program Area Within Department (i.e. Anthropology)
+Office* Office Location
+Office Hours (If applicable)
+Specialization* Research Areas/Specialization
+Publications Publications Listing (If applicable)
+Professional Society (If applicable)
+Academic Distinctions (If applicable)
+Research Interests (Please use "Specialization" Field)
+Personal Site Website Address (If applicable)
+
+Personal Profile
+----------------
+Title* Professional Title (i.e. Director of Publication Management)
+First Name* First Name / Middle Name
+Last Name* Last Name
+Bio Brief Bio/Profile/Blurb
+Short Bio Presentations (If applicable)
+Headshot* Photograph – Size should be width: 125px height: 150px
+Email* Email
+Phone* Phone # ‐ Please use this format: (111) 111‐1111
+Fax Lab Name, Lab Phone (If applicable, please use "Lab Name, Lab Phone" format)
+CV Resume
+
+* field required.
+
+If a basic text field (a field with no "editor") has more than one
+item in it then separate the items with a comma. For example: If a
+faculty member has more than one title, then list their titles like
+this: Professor of Communication, Director of Publication Management,
+Yearbook Advisor, etc.
+"""
+
+class AttributeHolder (object):
+ self.fields = []
+ def __init__(self, *args, **kwargs):
+ for field in self.fields:
+ setattr(self, field, None)
+ for field,arg in zip(self.fields, args):
+ setattr(self, field, arg)
+ for field,value in kwargs.items():
+ assert field in self.fields, '%s not in %s' % (field, self.fields)
+ setattr(self, field, value)
+
+
+class Name (AttributeHolder):
+ self.fields = ['first_middle', 'last']
+
+class Graduation (AttributeHolder):
+ self.fields = ['college', 'title', 'year']
+
+class Contact (AttributeHolder):
+ self.fields = ['office', 'website', 'phone', 'lab', 'lab_phone']
+
+class Bio (AttributeHolder):
+ self.fields = ['specialization', 'publications', 'profile', 'cv']
+
+class Professor (object):
+ self.fields = ['name', 'graduations', 'contact', 'bio']
import logging
import MySQLdb
+import yaml
-from . import get_logger
-from .prof_import import Name, Graduation, Contact, Bio, Professor
+from .. import get_logger
+from . import Name, Graduation, Contact, Bio, Professor
class SimpleDB (object):
Where PROF_FILE is the output YAML file receiving professor data.
Example:
- ./sitecore/prof_export.py profs.yaml
+ ./sitecore/prof/export_mysql.py profs.yaml
"""
p = optparse.OptionParser(usage)
p.add_option('-d', '--database', metavar='NAME', dest='database',
"""
from selenium.common.exceptions import NoSuchElementException
-
-from . import SiteCoreConnection
import yaml
-
-class AttributeHolder (object):
- self.fields = []
- def __init__(self, *args, **kwargs):
- for field in self.fields:
- setattr(self, field, None)
- for field,arg in zip(self.fields, args):
- setattr(self, field, arg)
- for field,value in kwargs.items():
- assert field in self.fields, '%s not in %s' % (field, self.fields)
- setattr(self, field, value)
-
-
-class Name (AttributeHolder):
- self.fields = ['first_middle', 'last']
-
-class Graduation (AttributeHolder):
- self.fields = ['college', 'title', 'year']
-
-class Contact (AttributeHolder):
- self.fields = ['office', 'website', 'phone', 'lab', 'lab_phone']
-
-class Bio (AttributeHolder):
- self.fields = ['specialization', 'publications', 'profile', 'cv']
-
-class Professor (object):
- self.fields = ['name', 'graduations', 'contact', 'bio']
+from .. import SiteCoreConnection
+from . import Name, Graduation, Contact, Bio, Professor
class ProfessorAdder (object):
Xvfb :99 > /dev/null 2>&1 &
export DISPLAY=:99
java -jar selenium-server-1.0.2-SNAPSHOT-standalone.jar > /dev/null 2>&1 &
- ./sitecore/prof_import.py profs.yaml
+ ./sitecore/prof/import.py profs.yaml
"""
p = optparse.OptionParser(usage)
p.add_option('-u', '--url', metavar='URL', dest='url',