Added get_table_info method.
This commit is contained in:
		
							parent
							
								
									27d570818e
								
							
						
					
					
						commit
						0a563cad53
					
				|  | @ -292,6 +292,21 @@ class Database: | ||||||
|         row = c.fetchone() |         row = c.fetchone() | ||||||
|         return row |         return row | ||||||
|      |      | ||||||
|  |     def get_table_info(self, hand_id): | ||||||
|  |         c = self.connection.cursor() | ||||||
|  |         c.execute(self.sql.query['get_table_name'], (hand_id, )) | ||||||
|  |         row = c.fetchone() | ||||||
|  |         l = list(row) | ||||||
|  |         if row[3] == "ring":   # cash game | ||||||
|  |             l.append(None) | ||||||
|  |             l.append(None) | ||||||
|  |             return l | ||||||
|  |         else:    # tournament | ||||||
|  |             tour_no, tab_no = re.split(" ", row[0]) | ||||||
|  |             l.append(tour_no) | ||||||
|  |             l.append(tab_no) | ||||||
|  |             return l | ||||||
|  | 
 | ||||||
|     def get_last_hand(self): |     def get_last_hand(self): | ||||||
|         c = self.connection.cursor() |         c = self.connection.cursor() | ||||||
|         c.execute(self.sql.query['get_last_hand']) |         c.execute(self.sql.query['get_last_hand']) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user