Closed zodman closed 10 years ago
don't want to be nittty picky, but can't you just do:
TESTNET_ENABLED=os.environ.get("BLA", True)
that will simplify the test a lot :)
if i set BLAH=10 python main.py it will be set.
Yo are passing/injection other value to the variable TESTNET_ENABLED = 10 and not true or false.
I mean you should change:
+ENABLE_TESTNET = False if not os.environ.get("ENABLE_TESTNET") else True
to:
+ENABLE_TESTNET = os.environ.get("ENABLE_TESTNET", False)
that way if defined it will take the value from environ.
set "export ENABLE_TESTNET=1"
that should work, not? do you mind the value will be set to string instead of bool? I don't think it's a problem.
the problem is when I do: "export ENABLE_TESTNET=0", then it will still be taken as true, but it's the same with your code, and we can recomment ppl to "unset ENABLE_TESNET" if they really don't wan't testnet, so... I recommend the more simple code I propose since it serves the same purpose.
ok i will replace it closet this
2014-04-04 18:16 GMT-06:00 caedesvvv notifications@github.com:
I mean you should change:
+ENABLE_TESTNET = False if not os.environ.get("ENABLE_TESTNET") else True
to:
+ENABLE_TESTNET = os.environ.get("ENABLE_TESTNET", False)
that way if defined it will take the value from environ.
set "export ENABLE_TESTNET=1"
that should work, not? do you mind the value will be set to string instead of bool? I don't think it's a problem.
the problem is when I do: "export ENABLE_TESTNET=0", then it will still be taken as true, but it's the same with your code, and we can recomment ppl to "unset ENABLE_TESNET" if they really don't wan't testnet, so... I recommend the more simple code I propose since it serves the same purpose.
— Reply to this email directly or view it on GitHubhttps://github.com/darkwallet/python-obelisk/pull/6#issuecomment-39623239 .
Andres Vargas www.zodman.com.mx
done!
great thanks!
on the cli you can switch to testnet chain with a enviroment variable