Skip to content

Commit

Permalink
Addresses @phildini suggestions
Browse files Browse the repository at this point in the history
- thanks.rocks is confusing
- removes commented out code
  • Loading branch information
tomdottom committed Jun 27, 2018
1 parent 577c1c4 commit b15754f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions tests/test_thanks.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_thanks_package(self):

thanks.package("crunchy-frog")

output = thanks.rocks(colored_output=False)
output = thanks.__str__(colored_output=False)

assert "You depend on 1 authors" in output
assert "crunchy-frog Kenneth Reitz" in output
Expand All @@ -51,7 +51,7 @@ def test_thanks_requirements_list(self):
mosw
"""))

output = thanks.rocks(colored_output=False)
output = thanks.__str__(colored_output=False)

assert "You depend on 2 authors" in output
assert "crunchy-frog Kenneth Reitz" in output
Expand All @@ -77,7 +77,7 @@ def test_thanks_pipfile(self):

thanks.pipfile(pipfile_contents)

output = thanks.rocks(colored_output=False)
output = thanks.__str__(colored_output=False)

assert "You depend on 2 authors" in output
assert "crunchy-frog Kenneth Reitz" in output
Expand Down
7 changes: 1 addition & 6 deletions thanks/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
@click.option("--pipfile", "-p",
multiple=True,
type=click.File("r"))
# @click.option("--setuppy", "-s",
# multiple=True,
# type=click.File("r"))
# @click.option("--poetry", type=click.Path(exists=True))
# @click.option("--hatch", type=click.Path(exists=True))
@click.option("--debug/--no-debug", default=False, help='Set debug mode')
@click.option("--outfile", "-o",
type=click.File("w"),
Expand All @@ -42,7 +37,7 @@ def main(package_name, requirements, pipfile, # setuppy,
for p in pipfile:
thanks.pipfile(p.read())

outfile.write(thanks.rocks())
outfile.write(str(thanks))


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion thanks/thanks.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,5 @@ def _uncolored(text, *args, **kwargs):

return '\n'.join(lines)

def rocks(self, colored_output=True):
def __str__(self, colored_output=True):
return self._generate_output(colored_output)

0 comments on commit b15754f

Please sign in to comment.