diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-10-31 21:10:28 -0700 |
---|---|---|
committer | Paul McGuire <ptmcg@users.noreply.github.com> | 2019-10-31 23:10:28 -0500 |
commit | 53d1b4a6f48a53c4c4ec4ac7031362b691c0366d (patch) | |
tree | 088ad3cf3561b78a00af4fb2fd474f4a2b8ca70c /examples/statemachine/libraryBookDemo.py | |
parent | 41752aa52cc97c710474bb2972cceab057b52ad4 (diff) | |
download | pyparsing-git-53d1b4a6f48a53c4c4ec4ac7031362b691c0366d.tar.gz |
Blacken the project (#141)
Diffstat (limited to 'examples/statemachine/libraryBookDemo.py')
-rw-r--r-- | examples/statemachine/libraryBookDemo.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/examples/statemachine/libraryBookDemo.py b/examples/statemachine/libraryBookDemo.py index 98f0b2b..61bdd6d 100644 --- a/examples/statemachine/libraryBookDemo.py +++ b/examples/statemachine/libraryBookDemo.py @@ -26,7 +26,11 @@ class RestrictedBook(Book): if user in self._authorized_users: super().checkout() else: - raise Exception("{} could not check out restricted book".format(user if user is not None else "anonymous")) + raise Exception( + "{} could not check out restricted book".format( + user if user is not None else "anonymous" + ) + ) def run_demo(): @@ -41,9 +45,9 @@ def run_demo(): print(book) try: book.checkout() - except Exception as e: # statemachine.InvalidTransitionException: + except Exception as e: # statemachine.InvalidTransitionException: print(e) - print('..cannot check out reserved book') + print("..cannot check out reserved book") book.release() print(book) book.checkout() @@ -58,13 +62,13 @@ def run_demo(): try: restricted_book.checkout(name) except Exception as e: - print('..' + str(e)) + print(".." + str(e)) else: - print('checkout to', name) + print("checkout to", name) print(restricted_book) restricted_book.checkin() print(restricted_book) -if __name__ == '__main__': +if __name__ == "__main__": run_demo() |