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

Changed env var check to a more elegant approach. Thanks, @bitprophet! #1271

Merged
merged 3 commits into from Apr 7, 2016

Conversation

Projects
None yet
3 participants
@bergbrains

bergbrains commented Feb 8, 2015

Jeff,

This is cleaned up and changed as per recommendations.

@bitprophet bitprophet added the Feature label Feb 28, 2015

@bitprophet bitprophet added this to the 1.11 milestone Feb 28, 2015

def _wrap_with(code):
def inner(text, bold=False):
c = code
if os.environ.get("FABRIC_DISABLE_COLORS", None):

This comment has been minimized.

@kaaveland

kaaveland Jan 25, 2016

This should probably check if is None, if the intention truly is to have any value for FABRIC_DISABLE_COLORS work. It's possible to set it to the empty string and this would then disable the colors. So either the documentation or the code should be updated to stay in sync.

Eric D. Berg added some commits Feb 5, 2016

Eric D. Berg
Changed check of FABRIC_DISABLE_COLORS env var to check for 'is None'…
… and updated docs for this environment variable.

@bitprophet bitprophet merged commit 7cfdc3c into fabric:master Apr 7, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

bitprophet added a commit that referenced this pull request Apr 7, 2016

def _wrap_with(code):
def inner(text, bold=False):
c = code
if os.environ.get('FABRIC_DISABLE_COLORS') is None:

This comment has been minimized.

@kaaveland

kaaveland Apr 8, 2016

I think maybe this contradicts the doc above now -- we'll only exit early here if FABRIC_DISABLE_COLORS is not set?

This comment has been minimized.

@bitprophet

bitprophet Apr 9, 2016

Member

Jeez, yea. Thanks! I didn't even test this by hand :( Just did now to confirm. Pushed fix. Wish the history here was clearer so I could remember what the original approach was, but meh. Works as described now. 4ed5c94

This comment has been minimized.

@bergbrains

bergbrains May 11, 2016

Great. Thanks, Jeff.

I'm an old Perl hacker and was hoping to get a better take on how to
manipulate the fab run environment with command line or config file options
too. haven't quite figured that out, but an env var is good for batch
processes.

Thanks again.

Eric

On Fri, Apr 8, 2016 at 11:35 PM, Jeff Forcier notifications@github.com
wrote:

In fabric/colors.py
#1271 (comment):

def _wrap_with(code):

 def inner(text, bold=False):
     c = code
  •    if os.environ.get('FABRIC_DISABLE_COLORS') is None:
    

Jeez, yea. Thanks! I didn't even test this by hand :( Just did now to
confirm. Pushed fix.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/fabric/fabric/pull/1271/files/7cfdc3ce430add37a3206aa959b7ec55cd0e813e#r59109647

eric berg
eberg@bergbrains.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment