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

Make eth-proxy not rely on the current working directory. #15

Open
wants to merge 2 commits 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
2 changes: 1 addition & 1 deletion eth-proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def main():
log.warning("-----------------------------------------------------------------------")

if __name__ == '__main__':
fp = file("eth-proxy.pid", 'w')
fp = file(sys.path[0]+"eth-proxy.pid", 'w')
fp.write(str(os.getpid()))
fp.close()
main()
Expand Down
10 changes: 5 additions & 5 deletions stratum/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def read_values(cfg):
yield (varname, value)

import config_default
import sys

if os.path.isfile('eth-proxy.conf'):
config = open('eth-proxy.conf','r').readlines()
if os.path.isfile(sys.path[0]+'/eth-proxy.conf'):
config = open(sys.path[0]+'/eth-proxy.conf','r').readlines()
else:
# Custom config not presented, but we can still use defaults
config = None

import sys
module = sys.modules[__name__]

for name,value in read_values(config_default):
Expand All @@ -56,8 +56,8 @@ def read_values(cfg):
changes["LOGLEVEL"] = "DEBUG"
module.__dict__["LOGLEVEL"] = "DEBUG"
if name=="LOG_TO_FILE" and value:
changes["LOGFILE"] = "proxy.log"
module.__dict__["LOGFILE"] = "proxy.log"
changes["LOGFILE"] = sys.path[0]+"proxy.log"
module.__dict__["LOGFILE"] = sys.path[0]+"proxy.log"
changes[name] = value
module.__dict__[name] = value

Expand Down