This repository has been archived by the owner on Jan 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change mirrors and make it easier for end users to switch (#82)
Fixes #81
- Loading branch information
1 parent
bc1edee
commit 03596df
Showing
4 changed files
with
77 additions
and
16 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
*.pyc | ||
/virtualenv/ | ||
/venv/ | ||
/dist/ | ||
/build/ | ||
/*.egg-info | ||
/.idea/ | ||
.coverage | ||
|
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,13 @@ | ||
"""Module to deal with decorators""" | ||
|
||
|
||
def execute_only_once(func): | ||
"""Decorator that will only allow a function to be executed the first time it's called""" | ||
def call_once(*args, **kwargs): | ||
if not call_once._called: | ||
try: | ||
return func(*args, **kwargs) | ||
finally: | ||
call_once._called = True | ||
call_once._called = False | ||
return call_once |
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