How to use the submit50.handler function in submit50

To help you get started, we’ve selected a few submit50 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cs50 / check50 / check50.py View on Github external
files = config.args.files

    if config.args.offline:
        config.args.local = True

    if not config.args.local:
        try:

            # Submit to check50 repo.
            import submit50
        except ImportError:
            raise InternalError(
                "submit50 is not installed. Install submit50 and run check50 again.")
        else:
            submit50.handler.type = "check"
            signal.signal(signal.SIGINT, submit50.handler)

            submit50.run.verbose = config.args.verbose
            username, commit_hash = submit50.submit("check50", identifier)

            # Wait until payload comes back with check data.
            print("Checking...", end="")
            sys.stdout.flush()
            pings = 0
            while True:

                # Terminate if no response.
                if pings > 45:
                    print()
                    cprint("check50 is taking longer than normal!", "red", file=sys.stderr)
                    cprint("See https://legacy.cs50.me/checks/{} for more detail.".format(commit_hash),
                           "red", file=sys.stderr)

submit50

This is submit50, with which you can submit solutions to problems for CS50.

GPL-3.0
Latest version published 6 months ago

Package Health Score

56 / 100
Full package analysis

Similar packages