Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --timestamp; makes timestamps optional but default off #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions BitcoinMiner.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,21 @@ def __init__(self, device, options):
def say(self, format, args=(), sayQuiet=False):
if self.options.quiet and not sayQuiet: return
with self.outputLock:
p = format % args
pool = self.pool[4]+' ' if self.pool else ''
outp = format % args
if self.options.outStamp:
outp = datetime.now().strftime(TIME_FORMAT) + ' ' + outp
if self.pool:
outp = self.pool[4] + ' ' + outp
if self.options.verbose:
print '%s%s,' % (pool, datetime.now().strftime(TIME_FORMAT)), p
print outp
else:
sys.stdout.write('\r%s\r%s%s' % (' '*80, pool, p))
sys.stdout.write('\r%s\r%s' % (' '*80, outp))
sys.stdout.flush()

def sayLine(self, format, args=()):
if not self.options.verbose:
format = '%s, %s\n' % (datetime.now().strftime(TIME_FORMAT), format)
self.say(format, args)
self.say(format + '\n', args)
else: self.say(format , args)

def sayQuiet(self, format, args=()):
self.say(format, args, True)
Expand Down
3 changes: 2 additions & 1 deletion README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Options:
-h, --help show this help message and exit
--verbose verbose output, suitable for redirection to log file
-q, --quiet suppress all output except hash rate display
-i, --timestamp add timestamp to output
--no-server-failbacks
disable using failback hosts provided by server

Expand Down Expand Up @@ -39,4 +40,4 @@ Options:
lag
-s FRAMESLEEP, --sleep=FRAMESLEEP
sleep per frame in seconds, default 0
-v, --vectors use vectors
-v, --vectors use vectors
1 change: 1 addition & 0 deletions poclbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
parser = OptionParser(version=USER_AGENT, usage=usage)
parser.add_option('--verbose', dest='verbose', action='store_true', help='verbose output, suitable for redirection to log file')
parser.add_option('-q', '--quiet', dest='quiet', action='store_true', help='suppress all output except hash rate display')
parser.add_option('-i', '--timestamp', dest='outStamp', action='store_true', help='add timestamp to output')

group = OptionGroup(parser, "Miner Options")
group.add_option('-r', '--rate', dest='rate', default=1, help='hash rate display interval in seconds, default=1', type='float')
Expand Down