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

Provides a smart way to determine the number 'top' lines #118

Merged
merged 5 commits into from Jun 3, 2016

Conversation

@MinchinWeb
Copy link
Contributor

MinchinWeb commented Mar 12, 2016

Looks at the prompt or PS1 environmental variables to determine the number of
newlines contained in them.

I've tested in on my end in Windows, and it works as expected. I don't have Linux or Mac box, so I haven't been able to test it there.

Because of the way it works (by counting newlines), it won't work exactly right if the prompt goes over the line end without a line break (i.e. for a really long path) or if there are conditional linebreaks in the PS1 variable.

Tests have been added and updated as well.

Fixes #102.

MinchinWeb added 2 commits Mar 12, 2016
…he '-N' parameter.

Looks at the prompt or PS1 environmental variables to determine the number of
newlines contained in them.

Fixes 102.
@codecov-io
Copy link

codecov-io commented Mar 12, 2016

Current coverage is 87.48%

Merging #118 into master will decrease coverage by 9.98%

  1. 5 files (not in diff) in topydo/cli were created. more
  2. 1 files (not in diff) in topydo were created. more
  3. 2 files in topydo/lib were modified. more
    • Hits +7
  4. 1 files in topydo were modified. more
  5. 9 files (not in diff) in topydo/lib were modified. more
    • Misses -3
    • Partials -2
    • Hits -55
  6. 6 files (not in diff) in topydo/commands were modified. more
    • Partials +2
    • Hits +9
  7. 4 files (not in diff) in topydo/lib were deleted. more
@@             master    #118   diff @@
=======================================
  Files            50      52     +2   
  Lines          2562    2724   +162   
  Methods           0       0          
  Branches        406     415     +9   
=======================================
- Hits           2497    2383   -114   
- Misses           38     315   +277   
+ Partials         27      26     -1   

Powered by Codecov. Last updated by 14ab34d...b1e47ed

Windows typically prints a free line after program output; Linux doesn't.
@MinchinWeb MinchinWeb force-pushed the MinchinWeb:fix-102 branch 2 times, most recently from 1d3dd64 to d8eb08a Apr 12, 2016
@bram85
Copy link
Owner

bram85 commented May 22, 2016

Change looks OK. Can you make sure to clean up the history such that Colors.py is not in the diff anymore? Then it looks OK to merge.

@MinchinWeb MinchinWeb force-pushed the MinchinWeb:fix-102 branch from d8eb08a to 9d2ae1c May 25, 2016
@MinchinWeb
Copy link
Contributor Author

MinchinWeb commented May 25, 2016

@bram85 : Colours.py "fixed"

@bram85
Copy link
Owner

bram85 commented May 26, 2016

@MinchinWeb I had another look at your code, and I was wondering why you implemented _N_lines in the ListFormat.py module instead of ListCommand.py. The latter is the only client and I don't see much coherence with the formatting functionality (i.e. replacing placeholders). Did you do this for a particular reason? If not, I'd prefer to see this calculation in ListCommand.py.

@MinchinWeb
Copy link
Contributor Author

MinchinWeb commented Jun 3, 2016

@bram85 : the _N_lines function was placed were it was because that seemed to match (my limited understanding of) the organization used in the project. But no worries, I've moved it as you've suggested.

@MinchinWeb MinchinWeb force-pushed the MinchinWeb:fix-102 branch from 230df54 to 87b8b01 Jun 3, 2016
@bram85 bram85 merged commit 1d19ce3 into bram85:master Jun 3, 2016
1 of 2 checks passed
1 of 2 checks passed
codecov/project 97.32% (-0.14%) compared to 14ab34d
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@MinchinWeb MinchinWeb deleted the MinchinWeb:fix-102 branch Jun 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.