Skip to content

Commit

Permalink
Merge pull request #37 from lifehackerhansol/master
Browse files Browse the repository at this point in the history
Fix CLI not working at all, and some other fixes
  • Loading branch information
zoogie authored Dec 29, 2021
2 parents 7bde6a2 + 5ceb4cf commit 9225edf
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions seedminer/seedminer_launcher3.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ def mii_gpu(year = 0, model = None):
command = "{} rws".format(init_command)
subprocess.call(command.split())
else:
command = "{} sws sm".format(init_command)
command = "{} sws".format(init_command)
proc = subprocess.call(command.split())
if proc == 251 or proc == 4294967291: # Help wanted for a better way of catching an exit code of '-5'
time.sleep(3) # Just wait a few seconds so we don't burn out our graphics card
subprocess.call("{} rws sm".format(init_command).split())
subprocess.call("{} rws".format(init_command).split())


def generate_part2():
Expand Down Expand Up @@ -272,6 +272,21 @@ def generate_part2():
f.write(part2)
print("movable_part2.sed generation success")

def is_id0_valid(id0):
try:
print(id0, end='')
sys.stdout.flush()
int(id0, 16)
if len(id0) == 32:
print(" -- valid ID0")
return True
else:
print(" -- improper ID0 length")
sys.stdout.flush()
return False
except:
print(" -- not an ID0")
return False

def hash_clusterer(id0 = None):
buf = b""
Expand Down Expand Up @@ -447,7 +462,7 @@ def error_print():
os.chdir(dname)

#Here the "__name__" == "__main__" part is needed in order to avoid the script from printing the error messages and exiting when imported from the other script
if "__name__" == "__main__":
if __name__ == "__main__":
if len(sys.argv) < 2 or len(sys.argv) > 4:
error_print()
sys.exit(1)
Expand Down

0 comments on commit 9225edf

Please sign in to comment.