Skip to content

[BUG] Output formatting incorrect when some flags disabled #6

Description

@ncdulo

Describe the bug
When weather is called with a partial set of output flags, there are gaps in the --pretty output where disabled data would reside. This is not ideal. The gaps are distracting and leave us with dirty output.

To Reproduce
Call weather current with a partial set of weather output options (-C/-t/-h/-w)

Expected behavior
Display text should be adjusted to compensate for disabled flags, or missing data. When flag is disabled, the text should silently skip over that section and output like it's not even there. When flag is enabled, but the data is missing from the response, return a NaN-type value. Example:

# Temperature flag disabled, Wind flag missing data
weather current Mars --pretty long -Chw 
Current conditions for Mars are
    Light snow
      87%RH, winds NaN at NaN m/s

Compare to actual output in the next section.

Output

weather current Mars --pretty long -Ch 
Current conditions for Mars are
    Light snow at 
      87%RH, winds  at

Desktop (please complete the following information):

  • OS/Distribution: Gentoo Linux 17.1 Desktop
  • Python 3.6.10
  • requests-2.23.0
  • click-7.1.1
  • Python virtual environment? Yes

Additional context
None required at this time.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions