def initConfig(self): svnNotipySvnLook = SvnNotipySVNLook(self.svnRepos, self.svnRevision) self.svnNotipyConfig = SvnNotipyConfig(self.baseDir) svnNotipyLdap = SvnNotipyLDAP(self.svnNotipyConfig.getLdapConfig()) self.svnAuthor = svnNotipySvnLook.getSvnAuthor() self.svnDate = svnNotipySvnLook.getSvnDate() self.svnLog = svnNotipySvnLook.getSvnCommitLog(0) self.svnLogForSubject = svnNotipySvnLook.getSvnCommitLog(1) self.svnDiffList = svnNotipySvnLook.getSvnDiffList() self.svnFilesChanged = svnNotipySvnLook.getSvnFilesChanged() self.svnRootDir = self.svnFilesChanged['rootdir'] self.svnAuthorRealName = svnNotipyLdap.getAuthorRealName(self.svnAuthor) self.svnAddedHtml = '' self.svnModifiedHtml = '' self.svnDeletedHtml = ''
def initConfig(self): svnNotipySvnLook = SvnNotipySVNLook(self.svnRepos, self.svnRevision) self.svnNotipyConfig = SvnNotipyConfig(self.baseDir) svnNotipyLdap = SvnNotipyLDAP(self.svnNotipyConfig.getLdapConfig()) self.svnAuthor = svnNotipySvnLook.getSvnAuthor() self.svnDate = svnNotipySvnLook.getSvnDate() self.svnLog = svnNotipySvnLook.getSvnCommitLog(0) self.svnLogForSubject = svnNotipySvnLook.getSvnCommitLog(1) self.svnDiffList = svnNotipySvnLook.getSvnDiffList() self.svnFilesChanged = svnNotipySvnLook.getSvnFilesChanged() self.svnRootDir = self.svnFilesChanged['rootdir'] self.svnAuthorRealName = svnNotipyLdap.getAuthorRealName( self.svnAuthor) self.svnAddedHtml = '' self.svnModifiedHtml = '' self.svnDeletedHtml = ''
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
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