adjust code formatting

This commit is contained in:
Jonathan Warren 2013-06-18 12:56:03 -04:00
parent 952524f7d5
commit 9ff2c9568f

View File

@ -8,18 +8,18 @@ import sys
def _set_idle(): def _set_idle():
if 'linux' in sys.platform: if 'linux' in sys.platform:
import os import os
os.nice(20) os.nice(20)
else: else:
try: try:
sys.getwindowsversion() sys.getwindowsversion()
import win32api,win32process,win32con import win32api,win32process,win32con
pid = win32api.GetCurrentProcessId() pid = win32api.GetCurrentProcessId()
handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, True, pid) handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, True, pid)
win32process.SetPriorityClass(handle, win32process.IDLE_PRIORITY_CLASS) win32process.SetPriorityClass(handle, win32process.IDLE_PRIORITY_CLASS)
except: except:
#Windows 64-bit #Windows 64-bit
pass pass
def _pool_worker(nonce, initialHash, target, pool_size): def _pool_worker(nonce, initialHash, target, pool_size):
_set_idle() _set_idle()
@ -70,6 +70,6 @@ def _doFastPoW(target, initialHash):
def run(target, initialHash): def run(target, initialHash):
if 'linux' in sys.platform: if 'linux' in sys.platform:
return _doFastPoW(target, initialHash) return _doFastPoW(target, initialHash)
else: else:
return _doSafePoW(target, initialHash) return _doSafePoW(target, initialHash)