示例#1
0
    def getApplicableConfigs(self, changedFiles, svnAuthor):
        configs = self.readAllConfigs()
        applicableConfigs = []

        svnNotipyLdap = SvnNotipyLDAP(self.getLdapConfig())
        for config in configs:
            # First check if the author is in the configured ldap group.
            # If this attribute is not set then skip the check.
            if config['authorInLdapGroup'] is not None:
                if svnNotipyLdap.isAuthorInGroup(svnAuthor, config['authorInLdapGroup']) == 0:
                    continue

            for path in config['controlledPaths']:
                for changedFile in changedFiles:
                    changedFile = '/' + changedFile
                    if (config['type'] == 'StartsWith' and changedFile.startswith(path)) or (config['type'] == 'Contains' and path in changedFile):
                        if applicableConfigs.count(config) == 0:
                            applicableConfigs.append(config)

        return applicableConfigs
示例#2
0
    def getApplicableConfigs(self, changedFiles, svnAuthor):
        configs = self.readAllConfigs()
        applicableConfigs = []

        svnNotipyLdap = SvnNotipyLDAP(self.getLdapConfig())
        for config in configs:
            # First check if the author is in the configured ldap group.
            # If this attribute is not set then skip the check.
            if config['authorInLdapGroup'] is not None:
                if svnNotipyLdap.isAuthorInGroup(
                        svnAuthor, config['authorInLdapGroup']) == 0:
                    continue

            for path in config['controlledPaths']:
                for changedFile in changedFiles:
                    changedFile = '/' + changedFile
                    if (config['type'] == 'StartsWith'
                            and changedFile.startswith(path)) or (
                                config['type'] == 'Contains'
                                and path in changedFile):
                        if applicableConfigs.count(config) == 0:
                            applicableConfigs.append(config)

        return applicableConfigs