Skip to main content

Simple python script converting polygon package to domjudge(kattis) package

Project description

Polygon2DOMjudge

中文

What is this

It is a simple python script converting polygon package to domjudge(kattis) package.

CLI Example

# Unzip your polygon-package to /path/to/polygon-package first
$ ./bin/p2d --code A --color FF0000 -o /path/to/domjudge-package /path/to/polygon-package

Run this command to make a package from /path/to/polygon-package to /path/to/domjudge-package.zip and set probcode and color.

Config

In config.json, you can change some special checker's validator's flag or add some checker configs manually.

You can use --default to force use the default output validator, and add some flags by command line.

You can use --auto to use the default output validator if the checker is defined in config and can be replaced by the default one.

You can use --memory_limit to override the memory limit for domjudge package, default is using the memory limit defined in polygon package.

You can use --output_limit to override the output limit for domjudge package, default is using the default output limit in domjudge setting.

Environment Variable

Don't change them unless you know what you are doing.

  • CONFIG_PATH
  • TESTLIB_PATH
  • EXTENTION_FOR_DESC

API Example

import tempfile

from p2d import Polygon2DOMjudge

package_dir = '/path/to/polygon-package'
output_file = '/path/to/domjudge-package.zip'

with tempfile.TemporaryDirectory() as temp_dir:
    try:
        Polygon2DOMjudge(package_dir, temp_dir, output_file).process()
    except Exception as e:
        # do something
        pass

Development

# install
poetry install

# build
poetry build

# run unittest
poetry run pytest

# release
./release.sh ${your version}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

p2d-0.0.3.tar.gz (48.6 kB view hashes)

Uploaded Source

Built Distribution

p2d-0.0.3-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page