From 1b9e29080db898af0aa30b0965df052424cf1250 Mon Sep 17 00:00:00 2001 From: Jeff Kala <48843785+jeffkala@users.noreply.github.com> Date: Fri, 15 Jul 2022 17:02:36 -0500 Subject: [PATCH] Few updates to PR of 125 (#129) * initial pass at type hinting and getting mypy to run * update tasks and ci to do mypy as well * rm unused import * fix contributing end-line number * fix contributing end-line number * Add py.typed file to signify availability of type hints to third parties. * Updates to type hinting. * Add EOS _build_banner type hints. * Address feedback. * Linting. * Remove .idea from commit and ignore in .gitignore. * Remove remnants of merge conflict. * PR feedback. * PR comments. * Ignore pylint errors for abstract-method. * Black. * add examples and better exception messaging Co-authored-by: Leo Kirchner --- netutils/password.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/netutils/password.py b/netutils/password.py index 5be0327d..ea44c890 100644 --- a/netutils/password.py +++ b/netutils/password.py @@ -195,16 +195,12 @@ def encrypt_type5(unencrypted_password: str, salt: t.Optional[str] = None, salt_ def encrypt_type7(unencrypted_password: str, salt: t.Optional[int] = None) -> str: """Given an unencrypted password of Cisco Type 7 password, encypt it. - Args: unencrypted_password: A password that has not been encrypted, and will be compared against. salt: A random number between 0 and 15 that can be set by the operator. Defaults to random generated one. - Returns: The encrypted password. - str (optional): The encrypted password. - - Example: + Examples: >>> from netutils.password import encrypt_type7 >>> encrypt_type7("cisco", 11) '110A1016141D'