@python: 3.5.2 @editor: PyCharm @create: 2017/7/26 19:09 @description: -- """ import os import sys sys.path.append(os.path.join(os.getcwd().split('scholar')[0],'scholar')) from BaseModule.ThesisClass import ThesisInfo from ErrorHandle.parse_error import except_pass from utils.connection import extract from ScholarConfig.me_berkeley_rule import RULES from nameparser import HumanName PS_ERROR = lambda func:except_pass(func,ModelName = 'me_berkeley') class MEBerkeleyClass(ThesisInfo): def __init__(self,sec): """ :param sec: item url """ self.sec = sec super(MEBerkeleyClass, self).__init__() self.generate_all_method() def _generate_avatar(self): self.avatar = extract(RULES["avatar"],self.sec) def _generate_firstName(self): tmp = extract(RULES["name"],self.sec)
import sys sys.path.append(os.path.join(os.getcwd().split('scholar')[0],'scholar')) import re from datetime import datetime from lxml import etree from BaseModule.ThesisClass import ThesisInfo from ErrorHandle.parse_error import except_pass from db.SqlHelper import SqlHelper from utils.connection import extract from ScholarConfig.cs_utexas_rule import RULES from nameparser import HumanName from TaskFeed.cs_utexas_task import CSUtexasTask PS_ERROR = lambda func:except_pass(func,ModelName = 'cs_utexas') class CSUtexasClass(ThesisInfo): def __init__(self,sec): """ :param sec: item url """ self.sec = sec super(CSUtexasClass, self).__init__() self.generate_all_method() def _generate_avatar(self): self.avatar = extract(RULES["avatar"],self.sec) def _generate_firstName(self): tmp = extract(RULES["info"],self.sec,multi=True)[0]