Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
3,799 additions
and
2,775 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,5 +1,5 @@ | ||
name: "Pull Request Docs Check" | ||
on: | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
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,27 @@ | ||
repos: | ||
|
||
- repo: https://github.com/ambv/black | ||
rev: 20.8b1 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.7.0 | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black", "--filter-files"] | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.10.0 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py36-plus] | ||
# - repo: https://github.com/asottile/blacken-docs | ||
# rev: v1.8.0 | ||
# hooks: | ||
# - id: blacken-docs | ||
# additional_dependencies: [black==20.8b1] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: flake8 |
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,31 +1,62 @@ | ||
import signal | ||
import time | ||
import os | ||
import signal | ||
import subprocess | ||
import time | ||
|
||
|
||
class GracefulKiller: | ||
kill_now = False | ||
|
||
def __init__(self): | ||
signal.signal(signal.SIGINT, self.exit_gracefully) | ||
signal.signal(signal.SIGTERM, self.exit_gracefully) | ||
|
||
def exit_gracefully(self,signum, frame): | ||
def exit_gracefully(self, signum, frame): | ||
self.kill_now = True | ||
|
||
if __name__ == '__main__': | ||
|
||
if __name__ == "__main__": | ||
killer = GracefulKiller() | ||
while True: | ||
synUser = os.environ['SYNAPSE_USERNAME'] | ||
synPass = os.environ['SYNAPSE_PASSWORD'] | ||
chalName = os.environ['CHALLENGE_NAME'] | ||
synUser = os.environ["SYNAPSE_USERNAME"] | ||
synPass = os.environ["SYNAPSE_PASSWORD"] | ||
chalName = os.environ["CHALLENGE_NAME"] | ||
|
||
validateSub = ['python','challenge.py','--challengeName',chalName,'-u',synUser,'-p',synPass,'--send-messages','--notifications','--acknowledge-receipt','validate','9603284','--admin','3336298'] | ||
archiveSub = ['python','challenge.py','--challengeName',chalName,'-u',synUser,'-p',synPass,'--notifications','archive','9603284'] | ||
validateSub = [ | ||
"python", | ||
"challenge.py", | ||
"--challengeName", | ||
chalName, | ||
"-u", | ||
synUser, | ||
"-p", | ||
synPass, | ||
"--send-messages", | ||
"--notifications", | ||
"--acknowledge-receipt", | ||
"validate", | ||
"9603284", | ||
"--admin", | ||
"3336298", | ||
] | ||
archiveSub = [ | ||
"python", | ||
"challenge.py", | ||
"--challengeName", | ||
chalName, | ||
"-u", | ||
synUser, | ||
"-p", | ||
synPass, | ||
"--notifications", | ||
"archive", | ||
"9603284", | ||
] | ||
|
||
subprocess.call(validateSub, stderr=subprocess.STDOUT) | ||
subprocess.call(archiveSub, stderr=subprocess.STDOUT) | ||
|
||
time.sleep(43200) | ||
if killer.kill_now: | ||
break | ||
print("End of the program. I was killed gracefully :)") | ||
print("End of the program. I was killed gracefully :)") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
from . import discussion | ||
from . import permissions | ||
from .__version__ import __version__ | ||
from . import discussion, permissions | ||
from .__version__ import __version__ |
Oops, something went wrong.