sio3pack.packages.package ========================= .. py:module:: sio3pack.packages.package Package Contents ---------------- .. py:class:: CompilerConfig(name, full_name, path, flags) Configuration class for a compiler. It holds the name, full name, path, and flags of the compiler. :param name: The name of the compiler. :param full_name: The full name of the compiler, including version. :param path: The path to the compiler executable. :param flags: The flags to use when compiling with this compiler. .. py:method:: detect() :classmethod: Detect the installed compilers and return them as the configuration. .. py:class:: SIO3PackConfig(django_settings=None, compilers_config = None, extensions_config = None, allow_unrecognized_files = False) Configuration class for SIO3Pack. It holds the configuration for compilers and file extensions. It can be initialized with Django settings or detected automatically. :param django_settings: Django settings object. :param compilers_config: Dictionary of compiler configurations. The keys are the compiler names, and the values are CompilerConfig objects. :param extensions_config: Dictionary of language configurations. The keys are the file extensions, and the values are the corresponding languages. .. py:method:: detect() :classmethod: Detect the installed compilers and return them as the configuration. .. py:class:: Package Bases: :py:obj:`sio3pack.utils.classinit.RegisteredSubclassesBase` Base class for all packages. :param str short_name: Short name of the problem. :param str full_name: Full name of the problem. :param bool is_from_db: If True, the package is created from the database. :param dict[str, str] lang_titles: A dictionary of problem titles, where keys are language codes and values are titles. :param dict[str, File] lang_statements: A dictionary of problem statements, where keys are language codes and values are files. :param dict[str, Any] config: Configuration of the problem. :param list[tuple[ModelSolutionKind, File]] model_solutions: A list of model solutions, where each element is a tuple containing a model solution kind and a file. :param list[File] additional_files: A list of additional files for the problem. :param list[File] attachments: A list of attachments related to the problem. :param WorkflowManager workflow_manager: A workflow manager for the problem. .. py:method:: identify(file) :classmethod: :abstractmethod: Identify if the package is of this type. .. py:method:: from_file(file, configuration=None) :classmethod: Create a package from a file. .. py:method:: identify_db(problem_id) :classmethod: :abstractmethod: Identify if the package is of this type. Should check if there is a package of this type in the database with the given problem_id. .. py:method:: from_db(problem_id, configuration = None) :classmethod: Create a package from the database. If sio3pack isn't installed with Django support, it should raise an ImproperlyConfigured exception. If there is no package with the given problem_id, it should raise an UnknownPackageType exception. .. py:method:: reload_config() .. py:method:: get_title(lang = None) :abstractmethod: .. py:method:: get_statement(lang = None) :abstractmethod: .. py:method:: reload_tests() .. py:method:: get_test(test_id) :abstractmethod: .. py:method:: has_test_gen() Check if the package has test generation. .. py:method:: has_verify() Check if the package has verification. .. py:method:: get_unpack_operation(return_func = None) .. py:method:: get_run_operation(program, tests = None, return_func = None) Get the run graph for the package. If the package doesn't have a run graph, it should return None. .. py:method:: get_user_out_operation(program, test, return_func = None) Get the workflow for getting the user's output for a given test. .. py:method:: get_test_run_operation(program, test, return_func = None) Get the workflow for running a test run. This means that the user can provide a test and the program, and the workflow will run the program with the test. .. py:method:: get_executable_path(program) Get the executable path for a given program. .. py:method:: get_cpp_compiler_full_name() Get the C++ compiler for the package. .. py:method:: get_cpp_compiler_path() Get the C++ compiler path for the package. .. py:method:: get_cpp_compiler_flags() Get the C++ compiler flags for the package. .. py:method:: get_python_compiler_full_name() Get the Python compiler for the package. .. py:method:: get_python_compiler_path() Get the Python compiler path for the package. .. py:method:: get_python_compiler_flags() Get the Python compiler flags for the package. .. py:method:: get_file_language(file) Returns the language of the given file. .. py:method:: save_to_db(problem_id) Save the package to the database. If sio3pack isn't installed with Django support, it should raise an ImproperlyConfigured exception. .. py:method:: get_time_limit_for_test(test) :abstractmethod: Get the time limit for a given test. .. py:method:: get_memory_limit_for_test(test) :abstractmethod: Get the memory limit for a given test.