sio3pack.django.sinolpack.handler ================================= .. py:module:: sio3pack.django.sinolpack.handler Module Contents --------------- .. py:class:: SinolpackDjangoHandler(package, problem_id) Bases: :py:obj:`sio3pack.django.common.handler.DjangoHandler` Handler for Sinolpack packages in Django. Has additional properties like config, model_solutions, additional_files and attachments. :param Sinolpack package: The Sinolpack package to handle. :param int problem_id: The problem ID. .. py:method:: save_to_db() Save the package to the database. .. py:property:: config :type: dict[str, Any] Config file of the package. .. py:property:: model_solutions :type: list[dict[str, Any]] A list of model solutions, where each element is a dictionary containing a :class:`RemoteFile` object and the :class:`sio3pack.packages.sinolpack.enums.ModelSolutionKind` kind. .. py:property:: additional_files :type: list[sio3pack.files.remote_file.RemoteFile] A list of additional files (as :class:`RemoteFile`) for the problem. .. py:property:: special_files :type: dict[str, sio3pack.files.remote_file.RemoteFile] A dictionary of special files (as :class:`RemoteFile`) for the problem. The keys are the types of the special files. .. py:property:: extra_execution_files :type: list[sio3pack.files.remote_file.RemoteFile] A list of extra execution files (as :class:`RemoteFile`) specified in the config file. .. py:property:: extra_compilation_files :type: list[sio3pack.files.remote_file.RemoteFile] A list of extra compilation files (as :class:`RemoteFile`) specified in the config file. .. py:property:: attachments :type: list[sio3pack.files.remote_file.RemoteFile] A list of attachments (as :class:`RemoteFile`) related to the problem. .. py:property:: extra_files :type: dict[str, sio3pack.files.remote_file.RemoteFile] A dictionary of extra files (as :class:`RemoteFile`) for the problem, as specified in the config file. The keys are the paths of the files in the package. .. py:method:: get_extra_file(package_path) Get an extra file (as :class:`RemoteFile`) for the problem. :param package_path: The path of the file in the package. :return: The extra file (as :class:`RemoteFile`) or None if it does not exist. .. py:attribute:: package .. py:attribute:: problem_id .. py:method:: get_executable_path(program) Get the executable path for the given program. :param File | str program: The program to get the path for. :return: The executable path or None if not found. .. py:property:: short_name :type: str Short name of the problem. .. py:property:: full_name :type: str Full name of the problem. .. py:property:: lang_titles :type: dict[str, str] A dictionary of problem titles, where keys are language codes and values are titles. .. py:property:: main_model_solution :type: sio3pack.files.remote_file.RemoteFile The main model solution as a :class:`RemoteFile`. .. py:property:: lang_statements :type: dict[str, sio3pack.files.remote_file.RemoteFile] A dictionary of problem statements, where keys are language codes and values are files. .. py:property:: tests :type: list[sio3pack.test.Test] A list of tests, where each element is a dictionary containing .. py:property:: workflows :type: dict[str, sio3pack.workflow.Workflow] A dictionary of workflows, where keys are workflow names and values are :class:`Workflow` objects.