-
Notifications
You must be signed in to change notification settings - Fork 75
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
1 parent
91b58d2
commit 9bdbfe9
Showing
7 changed files
with
100 additions
and
15 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
import yaml | ||
from django.core.management.base import BaseCommand | ||
|
||
from judge.bridge.daemon import judge_daemon | ||
|
||
|
||
class Command(BaseCommand): | ||
def add_arguments(self, parser): | ||
parser.add_argument('--monitor', action='store_true', default=False, | ||
help='if specified, run a monitor to automatically update problems') | ||
parser.add_argument('--problem-storage-globs', nargs='*', default=[], | ||
help='globs to monitor for problem updates') | ||
def add_arguments(self, parser) -> None: | ||
parser.add_argument('-c', '--config', type=str, help='file to load bridged configurations from') | ||
|
||
def handle(self, *args, **options): | ||
judge_daemon(options['monitor'], options['problem_storage_globs']) | ||
if options['config']: | ||
with open(options['config'], 'r') as f: | ||
config = yaml.safe_load(f) | ||
else: | ||
config = {} | ||
judge_daemon(config) |
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