コード例 #1
0
ファイル: data.py プロジェクト: Exeter/PEA_connect
		def getProfile(user):
			def clean(dirtyprofile):
				output = {}
				for x in dirtyprofile['PropertyData']:
					if x['Privacy'] == "Private":
						continue
					k = x['Name']
					if k == 'employeeID':
						k = 'EmployeeID'
					elif k == 'UserName':
						k = 'Username'
					elif k == 'Courses':
						k = 'Classes'

					values = x['Values']
					if values =="":
						continue
					v = []
					for value in values['ValueData']:
						v.append(value['Value'])
					if (len(v) == 1) and (k not in ['Organizations', 'Classes']):
						v = v[0]
					output[k] = v
				return output
			dirtyprofile = connect.to_dict(UserProfileService.service.GetUserProfileByName(user['login']))
			return clean(dirtyprofile)
コード例 #2
0
ファイル: data.py プロジェクト: Exeter/PEA_connect
	def download():
		print(":: Downloading raw user data")
		UserGroup = connect.getclient('https://connect.exeter.edu/_vti_bin/usergroup.asmx?WSDL')
		return connect.to_dict(UserGroup.service.GetAllUserCollectionFromWeb())