Package pulp :: Package server :: Package event
[hide private]
[frames] | no frames]

Source Code for Package pulp.server.event

 1  #! /usr/bin/env python 
 2  # 
 3  # Copyright (c) 2010 Red Hat, Inc. 
 4  # 
 5  # This software is licensed to you under the GNU General Public License, 
 6  # version 2 (GPLv2). There is NO WARRANTY for this software, express or 
 7  # implied, including the implied warranties of MERCHANTABILITY or FITNESS 
 8  # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 
 9  # along with this software; if not, see 
10  # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 
11  # 
12  # Red Hat trademarks are not licensed under GPLv2. No permission is 
13  # granted to use or replicate Red Hat trademarks that are incorporated 
14  # in this software or its documentation. 
15  # 
16   
17   
18  from threading import local as Local 
19   
20 -class EventFlags(Local):
21
22 - def __init__(self):
23 self.__suspended = []
24
25 - def suspended(self, subject):
26 return ( subject in self.__suspended )
27
28 - def suspend(self, subject):
29 self.__suspended.append(subject)
30
31 - def resume(self, subject):
32 if subject in self.__suspended: 33 self.__suspended.remove(subject)
34