Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Aug 10, 2021. It is now read-only.

Commit 94c5538

Browse filesBrowse files
author
Kenneth Reitz
committed
silence "not found"
1 parent 78e3c31 commit 94c5538
Copy full SHA for 94c5538

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed

‎bin/pip-grep

Copy file name to clipboardExpand all lines: bin/pip-grep
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,26 @@ def grep(reqfile, packages, silent=False):
3939
try:
4040
r = Requirements(reqfile)
4141
except ValueError:
42+
4243
if not silent:
4344
print 'There was a problem loading the given requirement file.'
45+
4446
exit(os.EX_NOINPUT)
4547

4648
for requirement in r.requirements:
4749

4850
if requirement.req:
4951

5052
if requirement.req.project_name in packages:
53+
5154
if not silent:
5255
print 'Package {} found!'.format(requirement.req.project_name)
56+
5357
exit(0)
5458

55-
print 'Not found.'.format(requirement.req.project_name)
59+
if not silent:
60+
print 'Not found.'.format(requirement.req.project_name)
61+
5662
exit(1)
5763

5864

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.