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

Added some Linux support for cgminer, and other python requests (for systems with python2.7 and python3.X) #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
31 changes: 23 additions & 8 deletions guiminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,12 +866,12 @@ def configure_subprocess_poclbm(self):
"""Set up the command line for poclbm."""
folder = get_module_path()
if USE_MOCK:
executable = "python mockBitcoinMiner.py"
executable = "python2.7 mockBitcoinMiner.py"
else:
if hasattr(sys, 'frozen'):
executable = "poclbm.exe"
else:
executable = "python poclbm.py"
executable = "python2.7 poclbm.py"
cmd = "%s %s:%s@%s:%s --device=%d --platform=%d --verbose -r1 %s" % (
executable,
self.txt_username.GetValue(),
Expand Down Expand Up @@ -917,7 +917,7 @@ def configure_subprocess_phoenix(self):
"""Set up the command line for phoenix miner."""
path = self.external_path
if path.endswith('.py'):
path = "python " + path
path = "python2.7 " + path

cmd = "%s -u http://%s:%s@%s:%s PLATFORM=%d DEVICE=%d %s" % (
path,
Expand All @@ -934,7 +934,7 @@ def configure_subprocess_cgminer(self):
"""Set up the command line for cgminer."""
path = self.external_path
if path.endswith('.py'):
path = "python " + path
path = "python2.7 " + path

# Command line arguments for cgminer here:
# -u <username>
Expand Down Expand Up @@ -993,20 +993,35 @@ def start_mining(self):
# for cgminer:
# We need only the STDOUT for meaningful messages.
if conf_func == self.configure_subprocess_cgminer:
self.miner = subprocess.Popen(cmd, cwd=cwd,
if sys.platform == "win32":
self.miner = subprocess.Popen(cmd, cwd=cwd,
stdout=subprocess.PIPE,
stderr=None,
universal_newlines=True,
creationflags=flags,
shell=(sys.platform != 'win32'))
elif sys.platform == "linux2":
self.miner = subprocess.Popen(cmd, cwd=cwd,
stdout=subprocess.PIPE,
stderr=None,
universal_newlines=True,
creationflags=flags,
shell="/bin/sh")
else:
self.miner = subprocess.Popen(cmd, cwd=cwd,
if sys.platform == "win32":
self.miner = subprocess.Popen(cmd, cwd=cwd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
creationflags=flags,
shell=(sys.platform != 'win32'))

shell=(sys.platform != "win32"))
elif sys.platform == "linux2":
self.miner = subprocess.Popen(cmd, cwd=cwd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True,
creationflags=flags,
shell="/bin/sh")
except OSError:
raise #TODO: the folder or exe could not exist
self.miner_listener = listener_cls(self, self.miner)
Expand Down