I like to know what DEVICE each miner is running on. And in cssh I'm using very compact terminals, so they all fit on a screen, so I like more compact status line. Here's a diff for anyone interested:
Index: phoenix.py
===================================================================
--- phoenix.py (revision 56)
+++ phoenix.py (working copy)
@@ -110,6 +110,7 @@
exit()
kernelModule = imp.load_module(module, file, filename, smt)
self.kernel = kernelModule.MiningKernel(requester)
+ self.logger.DEVICE = self.kernel.DEVICE
return self.kernel
def makeQueue(self, requester):
@@ -122,4 +123,4 @@
miner = Miner()
miner.start(options)
- reactor.run()
\ No newline at end of file
+ reactor.run()
Index: ConsoleLogger.py
===================================================================
--- ConsoleLogger.py (revision 56)
+++ ConsoleLogger.py (working copy)
@@ -56,6 +56,7 @@
self.lineLength = 0
self.connectionType = None
self.idle = False
+ self.DEVICE = -1
def reportRate(self, rate, update=True):
"""Used to tell the logger the current Khash/sec."""
@@ -115,9 +116,9 @@
rate = self.rate if (not self.idle) else 0
type = " [" + str(self.connectionType) + "]" if self.connectionType is not None else ''
status = (
- "[" + formatNumber(rate) + "hash/sec] "
- "[" + str(self.accepted) + " Accepted] "
- "[" + str(self.invalid) + " Rejected]" + type)
+ "[" + formatNumber(rate) + "Hs/s] "
+ "[" + str(self.accepted) + " Acc] "
+ "[" + str(self.invalid) + " Rej]" + type + " [D "+str(self.DEVICE)+"]")
self.say(status)
self.lastUpdate = time()
@@ -152,4 +153,4 @@
self.say(message, True, hideTimestamp)
if update:
self.updateStatus(True)
-
\ No newline at end of file
+
I am learning python, so I am sure that this can be written in a better way. I would like to learn in which way? Anyway, this diff will produce a status line like this:
[298.44 MHs/s] [15 Acc] [0 Rej] [RPC (+LP)] [D 3]
the last number is the device number.