<commit_before>#
# Copyright (c) 2009 rPath, Inc.
#
# All Rights Reserved
#
from mint import amiperms

class AWSHandler(object):
    def __init__(self, cfg, db):
        self.db = db
        self.amiPerms = amiperms.AMIPermissionsManager(cfg, db)

    def notify_UserProductRemoved(self, event, userId, projectId, userlevel = None):
        self.amiPerms.addMemberToProject(userId, projectId)

    def notify_UserProductAdded(self, event, userId, projectId, userlevel = None):
        self.amiPerms.deleteMemberFromProject(userId, projectId)

    def notify_UserProductChanged(self, event, userId, projectId, oldLevel,
                                  newLevel):
        self.amiPerms.setMemberLevel(userId, projectId, oldLevel, newLevel)

    def notify_UserCancelled(self, userId):
        # yuck.
        awsFound, oldAwsAccountNumber = self.db.userData.getDataValue(
                                                userId, 'awsAccountNumber')
        self.amiPerms.setUserKey(userId, oldAwsAccountNumber, None)

    def notify_ReleasePublished(self, releaseId):
        self.amiPerms.publishRelease(releaseId)

    def notify_ReleaseUnpublished(self, releaseId):
        self.amiPerms.unpublishRelease(releaseId)<commit_msg>Fix typo when setting up handler.<commit_after>#
# Copyright (c) 2009 rPath, Inc.
#
# All Rights Reserved
#
from mint import amiperms

class AWSHandler(object):
    def __init__(self, cfg, db):
        self.db = db
        self.amiPerms = amiperms.AMIPermissionsManager(cfg, db)

    def notify_UserProductRemoved(self, event, userId, projectId, userlevel = None):
        self.amiPerms.deleteMemberFromProject(userId, projectId)

    def notify_UserProductAdded(self, event, userId, projectId, userlevel = None):
        self.amiPerms.addMemberToProject(userId, projectId)

    def notify_UserProductChanged(self, event, userId, projectId, oldLevel,
                                  newLevel):
        self.amiPerms.setMemberLevel(userId, projectId, oldLevel, newLevel)

    def notify_UserCancelled(self, userId):
        # yuck.
        awsFound, oldAwsAccountNumber = self.db.userData.getDataValue(
                                                userId, 'awsAccountNumber')
        self.amiPerms.setUserKey(userId, oldAwsAccountNumber, None)

    def notify_ReleasePublished(self, releaseId):
        self.amiPerms.publishRelease(releaseId)

    def notify_ReleaseUnpublished(self, releaseId):
        self.amiPerms.unpublishRelease(releaseId)
{'fraction_non_alphanumeric': 0.0867635189669088, 'fraction_numerical': 0.003228410008071025, 'mean_word_length': 3.097520661157025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7456395', 'n_tokens_mistral': 723, 'n_tokens_neox': 721, 'n_words': 150}