forked from bismuthfoundation/Bismuth-GPU-miner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoptions.py
29 lines (27 loc) · 1.48 KB
/
options.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os.path as path
class Get:
def read(self):
if not path.exists("config_custom.txt"):
lines = [line.rstrip('\n') for line in open('config.txt')]
else:
lines = [line.rstrip('\n') for line in open('config_custom.txt')]
for line in lines:
if "pool_ip=" in line:
self.pool_ip_conf = line.replace('pool_ip=', '')
if "miner_address=" in line:
self.miner_address_conf = line.replace('miner_address=', '')
if "miner_name=" in line:
self.miner_name_conf = line.replace('miner_name=', '')
if "miner_debug=" in line:
self.miner_debug_conf = line.replace('miner_debug=', '')
if "opencl_hash_count=" in line:
self.opencl_hash_count_conf = int(line.replace('opencl_hash_count=', ''))
if "opencl_timeout=" in line:
self.opencl_timeout_conf = int(line.replace('opencl_timeout=', ''))
if "opencl_thread_multiplier=" in line:
self.opencl_thread_multiplier_conf = int(line.replace('opencl_thread_multiplier=', ''))
if "opencl_full_check=" in line:
self.opencl_full_check_conf= int(line.replace('opencl_full_check=', ''))
if "opencl_disable_device=" in line:
str = line.replace('opencl_disable_device=', '')
self.opencl_disable_device_conf = [int(d.strip()) for d in str.split(",") if len(d.strip()) > 0 ]