"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "buildbot/process/users/users.py" between
buildbot-3.0.2.tar.gz and buildbot-3.1.0.tar.gz

About: Buildbot is a continuous integration testing framework (Python-based). It supports also automation of complex build systems, application deployment, and management of sophisticated software-release processes.

users.py  (buildbot-3.0.2):users.py  (buildbot-3.1.0)
skipping to change at line 24 skipping to change at line 24
# Copyright Buildbot Team Members # Copyright Buildbot Team Members
import os import os
from binascii import hexlify from binascii import hexlify
from hashlib import sha1 from hashlib import sha1
from twisted.internet import defer from twisted.internet import defer
from twisted.python import log from twisted.python import log
from buildbot.util import bytes2unicode from buildbot.util import bytes2unicode
from buildbot.util import flatten
from buildbot.util import unicode2bytes from buildbot.util import unicode2bytes
# TODO: fossil comes from a plugin. We should have an API that plugins could use to # TODO: fossil comes from a plugin. We should have an API that plugins could use to
# register allowed user types. # register allowed user types.
srcs = ['git', 'svn', 'hg', 'cvs', 'darcs', 'bzr', 'fossil'] srcs = ['git', 'svn', 'hg', 'cvs', 'darcs', 'bzr', 'fossil']
salt_len = 8 salt_len = 8
def createUserObject(master, author, src=None): def createUserObject(master, author, src=None):
""" """
Take a Change author and source and translate them into a User Object, Take a Change author and source and translate them into a User Object,
skipping to change at line 98 skipping to change at line 97
@param uid: user that is searched for the contact_types match @param uid: user that is searched for the contact_types match
@type uid: integer @type uid: integer
@returns: string of contact information or None via deferred @returns: string of contact information or None via deferred
""" """
d = master.db.users.getUser(uid) d = master.db.users.getUser(uid)
d.addCallback(_extractContact, contact_types, uid) d.addCallback(_extractContact, contact_types, uid)
return d return d
def _filter(contacts):
def notNone(c):
return c is not None
return filter(notNone, contacts)
def getUsersContacts(master, contact_types, uids):
d = defer.gatherResults(
[getUserContact(master, contact_types, uid) for uid in uids])
d.addCallback(_filter)
return d
def getChangeContacts(master, change, contact_types):
d = master.db.changes.getChangeUids(change.number)
d.addCallback(lambda uids: getUsersContacts(master, contact_types, uids))
return d
def getSourceStampContacts(master, ss, contact_types):
dl = [getChangeContacts(master, change, contact_types)
for change in ss.changes]
if False and ss.patch_info:
d = master.db.users.getUserByUsername(ss.patch_into[0])
d.addCallback(_extractContact, contact_types, ss.patch_info[0])
d.addCallback(lambda contact: filter(None, [contact]))
dl.append(d)
d = defer.gatherResults(dl)
d.addCallback(flatten)
return d
def getBuildContacts(master, build, contact_types):
dl = []
ss_list = build.getSourceStamps()
for ss in ss_list:
dl.append(getSourceStampContacts(master, ss, contact_types))
d = defer.gatherResults(dl)
d.addCallback(flatten)
@d.addCallback
def addOwners(recipients):
dl = []
for owner in build.getInterestedUsers():
d = master.db.users.getUserByUsername(owner)
d.addCallback(_extractContact, contact_types, owner)
dl.append(d)
d = defer.gatherResults(dl)
d.addCallback(_filter)
d.addCallback(lambda owners: recipients + owners)
return d
return d
def encrypt(passwd): def encrypt(passwd):
""" """
Encrypts the incoming password after adding some salt to store Encrypts the incoming password after adding some salt to store
it in the database. it in the database.
@param passwd: password portion of user credentials @param passwd: password portion of user credentials
@type passwd: string @type passwd: string
@returns: encrypted/salted string @returns: encrypted/salted string
""" """
 End of changes. 2 change blocks. 
50 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)