Commits

Jason R. Coombs committed 7571d48

util.karmaChange needs to accept the legacy DB parameter

  • Participants
  • Parent commits 2b6171a

Comments (0)

Files changed (1)

File pmxbot/util.py

 
 from . import storage
 
-ball8_opts = { 
+ball8_opts = {
 "Signs point to yes." : 21,
 "Yes." : 21,
 "Most likely." : 21,
 'pipe',
 'bat',
 'stickbat',
-'wooden pallet', 
+'wooden pallet',
 ]
 
 weapon_adjs = [
 		question, choices = s.rsplit(':', 1)
 	else:
 		choices = s
-	
+
 	c = choices.split(',')
 	if ' or ' in c[-1]:
 		c = c[:-1] + c[-1].split(' or ')
-	
+
 	c = [x.strip() for x in c]
 	c = filter(None, c)
 	return c
 		thing = thing.strip().lower()
 		LOOKUP_SQL = 'SELECT karmavalue from karma_keys k join karma_values v on k.karmaid = v.karmaid where k.karmakey = ?'
 		try:
-			karma = self.db.execute(LOOKUP_SQL, [thing]).fetchone()[0] 
+			karma = self.db.execute(LOOKUP_SQL, [thing]).fetchone()[0]
 		except:
 			karma = 0
 		if karma == None:
 	)
 
 # for backward compatibility:
-def karmaChange(*args, **kwargs):
+def karmaChange(db, *args, **kwargs):
 	return karma.change(*args, **kwargs)
 
 def init_quotes(uri):
 				for rec in log_db.find(fields=[])
 			)
 		return logging.Logger.log_id_map
-		
+
 
 	def import_(self, quote):
 		log_id_map = self._build_log_id_map()
 def strip_tags(string):
 	"""
 	Remove HTML tags from a string.
-	
+
 	>>> strip_tags('<div>foo and <b>bar</b></div>')
 	'foo and bar'
 	"""
 		ans = html[idx+4:edx]
 		ans = html_strip.sub('', ans)
 		all.append(ans)
-		
+
 	return all
 
 # passive-aggresive statement generator