Changeset 33517 for trunk/ippToPsps
- Timestamp:
- Mar 13, 2012, 4:25:53 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/ipptopspsdb.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/ipptopspsdb.py
r33490 r33517 724 724 725 725 ''' 726 Pause allloading clients727 ''' 728 def pause AllLoaders(self, bool):729 self.setColFor AllLoaders("paused", bool)730 731 ''' 732 Kill allloading clients733 ''' 734 def kill AllLoaders(self, bool):735 self.setColFor AllLoaders("killed", bool)726 Pause loading clients 727 ''' 728 def pauseLoaders(self, bool, ids): 729 self.setColForLoaders("paused", bool, ids) 730 731 ''' 732 Kill loading clients 733 ''' 734 def killLoaders(self, bool, ids): 735 self.setColForLoaders("killed", bool, ids) 736 736 737 737 ''' 738 738 Sets the value for a given column in the clients table 739 739 ''' 740 def setColForAllLoaders(self, col, bool): 740 def setColForLoaders(self, col, bool, ids): 741 741 742 if bool: value = 1 742 743 else: value = 0 743 self.execute("UPDATE clients SET " + col + " = " + str(value) + " WHERE type = 'loader.py' AND config = '" + self.config.name + "'") 744 745 for id in ids: 746 self.execute("UPDATE clients SET " + col + " = " + str(value) + " \ 747 WHERE type = 'loader.py' \ 748 AND id = " + str(id)) 749 750 ''' 751 Remove client by id 752 ''' 753 def removeClientsByIds(self, ids): 754 for id in ids: 755 self.execute("DELETE FROM clients WHERE id = " + str(id)) 744 756 745 757 ''' … … 996 1008 WHERE ra_center = " + str(raCenter) + " \ 997 1009 AND batch_type = '" + batchType + "' \ 998 AND config = '" + self.config.name + "'" 1010 AND config = '" + self.config.name + "' \ 1011 ORDER BY dec_center DESC" 999 1012 1000 1013 try: … … 1187 1200 1188 1201 ''' 1202 Gets client info 1203 ''' 1204 def getClientInfo(self): 1205 1206 sql = "SELECT id, host, started, timestamp, ra_center, paused, killed \ 1207 FROM stripe \ 1208 JOIN clients ON (client_id = id) \ 1209 WHERE clients.config = '" + self.config.name + "' \ 1210 ORDER BY host, started" 1211 1212 rows = [] 1213 try: 1214 rs = self.executeQuery(sql) 1215 while (rs.next()): 1216 rows.append([rs.getInt(1), rs.getString(2), rs.getString(3), rs.getString(4), rs.getFloat(5), rs.getInt(6), rs.getInt(7)]) 1217 rs.close() 1218 except: 1219 self.logger.errorPair("Can't query for client data", sql) 1220 1221 return rows 1222 1223 ''' 1189 1224 Destructor 1190 1225 '''
Note:
See TracChangeset
for help on using the changeset viewer.
