-
-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show a progress of a hashes generation process in a verbose mode
- Loading branch information
Showing
4 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Ported from python 3.7 contextlib.py | ||
class nullcontext(object): | ||
"""Context manager that does no additional processing. | ||
Used as a stand-in for a normal context manager, when a particular | ||
block of code is only sometimes used with a normal context manager: | ||
cm = optional_cm if condition else nullcontext() | ||
with cm: | ||
# Perform operation, using optional_cm if condition is True | ||
""" | ||
|
||
def __init__(self, enter_result=None): | ||
self.enter_result = enter_result | ||
|
||
def __enter__(self): | ||
return self.enter_result | ||
|
||
def __exit__(self, *excinfo): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters