Git#

Server#

class GitBaseHandler(application: grader_service.server.GraderServer, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]#

Bases: grader_service.handlers.base_handler.GraderBaseHandler

async data_received(chunk: bytes)[source]#

Implement this method to handle streamed request data.

Requires the .stream_request_body decorator.

May be a coroutine for flow control.

get_gitdir(rpc: str)[source]#

Determine the git repository for this request

async git_response()[source]#
gitlookup(rpc: str)[source]#
hub_api_base_path: str#
on_finish()[source]#

Called after the end of a request.

Override this method to perform cleanup, logging, etc. This method is a counterpart to prepare. on_finish may not produce any output, as it is called after the response has been sent to the client.

write_error(status_code: int, **kwargs) None[source]#

Override to implement custom error pages.

write_error may call write, render, set_header, etc to produce output as usual.

If this error was caused by an uncaught exception (including HTTPError), an exc_info triple will be available as kwargs["exc_info"]. Note that this exception may not be the “current” exception for purposes of methods like sys.exc_info() or traceback.format_exc.

class InfoRefsHandler(application: grader_service.server.GraderServer, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]#

Bases: grader_service.handlers.git.server.GitBaseHandler

Request handler for info/refs

Use this handler to handle example.git/info/refs?service= URLs

async get()[source]#
hub_api_base_path: str#
async prepare()[source]#

Called at the beginning of a request before get/post/etc.

Override this method to perform common initialization regardless of the request method.

Asynchronous support: Use async def or decorate this method with .gen.coroutine to make it asynchronous. If this method returns an Awaitable execution will not proceed until the Awaitable is done.

New in version 3.1: Asynchronous support.

class RPCHandler(application: grader_service.server.GraderServer, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]#

Bases: grader_service.handlers.git.server.GitBaseHandler

Request handler for RPC calls

Use this handler to handle example.git/git-upload-pack and example.git/git-receive-pack URLs

hub_api_base_path: str#
async post(rpc)[source]#
async prepare()[source]#

Called at the beginning of a request before get/post/etc.

Override this method to perform common initialization regardless of the request method.

Asynchronous support: Use async def or decorate this method with .gen.coroutine to make it asynchronous. If this method returns an Awaitable execution will not proceed until the Awaitable is done.

New in version 3.1: Asynchronous support.