示例#1
0
 def begin(self):
     if self.in_transaction():
         self.abort()
     self.collectors = adict({p: deque() for p in self.updates.keys()})
示例#2
0
 def load_state(self, data):
     self.stdout = data['stdout']
     self.logs = adict(data['logs'])
     self.updates = adict(data['updates'])
     if 'collectors' in data:
         self.collectors = adict(data['collectors'])
示例#3
0
 def get_full(self, player=None):
     if player is not None:
         return ''.join(self.logs[player])
     return adict({p: ''.join(self.logs[p]) for p in self.logs})
示例#4
0
 def __init__(self, *players, stdout=False):
     self.stdout = stdout
     self.logs = adict({p: deque() for p in players})
     self.updates = adict({p: deque() for p in players})
     self.collectors = None
示例#5
0
文件: util.py 项目: felixludos/tnt
	def reset(self, *players):
		self.logs = adict({p:deque() for p in players})
		self.updates = adict({p:deque() for p in players})
		self.collectors = None