Skip to content

Commit bb44097

Browse files
committed
fix(submit client): Allow printing in any language
It is not necessary to select entry_porint when printing. Signed-off-by: cubercsl <[email protected]>
1 parent 047f4f7 commit bb44097

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

submit/submit

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ elif contests:
506506
languages: list = []
507507
problems: list = []
508508
if my_contest and baseurl:
509-
if 'allow_submit' in my_contest and not my_contest['allow_submit']:
509+
if not args.print and 'allow_submit' in my_contest and not my_contest['allow_submit']:
510510
warn_user('Submissions for contest (temporarily) disabled')
511511
exit(1)
512512
languages = read_languages()
@@ -610,23 +610,25 @@ for problem in problems:
610610
if not my_problem and not args.print:
611611
usage('No known problem specified or detected.')
612612

613-
# Guess entry point if not already specified.
614-
if not entry_point and my_language['entry_point_required']:
615-
if my_language['name'] == 'Java':
616-
entry_point = filebase
617-
elif my_language['name'] == 'Kotlin':
618-
entry_point = kotlin_base_entry_point(filebase) + "Kt"
619-
elif my_language['name'] == 'Python 3':
620-
entry_point = filebase + "." + ext
621-
622-
if not entry_point and my_language['entry_point_required']:
623-
error('Entry point required but not specified nor detected.')
613+
if not args.print:
614+
# Guess entry point if not already specified.
615+
if not entry_point and my_language['entry_point_required']:
616+
if my_language['name'] == 'Java':
617+
entry_point = filebase
618+
elif my_language['name'] == 'Kotlin':
619+
entry_point = kotlin_base_entry_point(filebase) + "Kt"
620+
elif my_language['name'] == 'Python 3':
621+
entry_point = filebase + "." + ext
622+
623+
if not entry_point and my_language['entry_point_required']:
624+
error('Entry point required but not specified nor detected.')
624625

625626
logging.debug(f"contest is `{my_contest['shortname']}'")
626627
if not args.print:
627628
logging.debug(f"problem is `{my_problem['label']}'")
628-
logging.debug(f"language is `{my_language['name']}'")
629-
logging.debug(f"entry_point is `{entry_point or '<None>'}'")
629+
logging.debug(f"language is `{my_language.get('name', '<None>')}'")
630+
if not args.print:
631+
logging.debug(f"entry_point is `{entry_point or '<None>'}'")
630632
logging.debug(f"url is `{baseurl}'")
631633

632634
if args.print:

0 commit comments

Comments
 (0)