Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
ghc
git
libcap-dev
libcups2-dev
libffi-dev
libpq-dev
libyaml-dev
Expand Down
11 changes: 0 additions & 11 deletions cms/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,6 @@ class ProxyServiceConfig:
https_certfile: str | None = None


@dataclass()
class PrintingServiceConfig:
max_print_length: int = 10_000_000 # 10 MB
printer: str | None = None
paper_size: str = "A4"
max_pages_per_job: int = 10
max_jobs_per_user: int = 10
pdf_printing_allowed: bool = False


@dataclass()
class PrometheusConfig:
listen_address: str = "127.0.0.1"
Expand Down Expand Up @@ -186,7 +176,6 @@ class Config:
contest_web_server: CWSConfig = field_helper(CWSConfig)
admin_web_server: AWSConfig = field_helper(AWSConfig)
proxy_service: ProxyServiceConfig = field_helper(ProxyServiceConfig)
printing: PrintingServiceConfig = field_helper(PrintingServiceConfig)
prometheus: PrometheusConfig = field_helper(PrometheusConfig)
telegram_bot: TelegramBotConfig | None = None
# This is the one that will be provided in the config file.
Expand Down
5 changes: 1 addition & 4 deletions cms/db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
# usertest
"UserTest", "UserTestFile", "UserTestManager", "UserTestResult",
"UserTestExecutable",
# printjob
"PrintJob",
# init
"init_db",
# drop
Expand All @@ -81,7 +79,7 @@

# Instantiate or import these objects.

version = 46
version = 47

engine = create_engine(config.database.url, echo=config.database.debug,
pool_timeout=60, pool_recycle=120)
Expand All @@ -103,7 +101,6 @@
Executable, Evaluation
from .usertest import UserTest, UserTestFile, UserTestManager, \
UserTestResult, UserTestExecutable
from .printjob import PrintJob

from .init import init_db
from .drop import drop_db
Expand Down
75 changes: 0 additions & 75 deletions cms/db/printjob.py

This file was deleted.

8 changes: 1 addition & 7 deletions cms/db/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from . import CastingArray, Codename, Base, Admin, Contest
import typing
if typing.TYPE_CHECKING:
from . import PrintJob, Submission, UserTest
from . import Submission, UserTest

class User(Base):
"""Class to store a user.
Expand Down Expand Up @@ -271,12 +271,6 @@ class Participation(Base):
passive_deletes=True,
back_populates="participation")

printjobs: list["PrintJob"] = relationship(
"PrintJob",
cascade="all, delete-orphan",
passive_deletes=True,
back_populates="participation")


class Message(Base):
"""Class to store a private message from the managers to the
Expand Down
7 changes: 0 additions & 7 deletions cms/db/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
UserTestManager,
UserTestResult,
UserTestExecutable,
PrintJob,
Session,
)

Expand Down Expand Up @@ -309,7 +308,6 @@ def enumerate_files(
skip_submissions=False,
skip_user_tests=False,
skip_users=False,
skip_print_jobs=False,
skip_generated=False,
) -> set[str]:
"""Enumerate all the files (by digest) referenced by the
Expand Down Expand Up @@ -363,11 +361,6 @@ def enumerate_files(
.filter(UserTestResult.output != None)
.with_entities(UserTestResult.output))

if not skip_print_jobs and not skip_users:
queries.append(contest_q.join(Contest.participations)
.join(Participation.printjobs)
.with_entities(PrintJob.digest))

# union(...).execute() would be executed outside of the session.
digests = set(r[0] for r in session.execute(union(*queries)))
digests.discard(Digest.TOMBSTONE)
Expand Down
126 changes: 27 additions & 99 deletions cms/locale/ar/LC_MESSAGES/cms.po
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

msgid ""
msgstr ""
"Project-Id-Version: VERSION\n"
"Project-Id-Version: VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2025-08-16 14:52+0300\n"
"POT-Creation-Date: 2025-11-09 23:31+0100\n"
"PO-Revision-Date: 2025-10-07 18:02+0000\n"
"Last-Translator: Muaath Alqarni <translate@muaath.dev>\n"
"Language-Team: Arabic <https://hosted.weblate.org/projects/cms/main/ar/>\n"
"Language: ar\n"
"Language-Team: Arabic <https://hosted.weblate.org/projects/cms/main/ar/>\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
"X-Generator: Weblate 5.14-dev\n"
"Generated-By: Babel 2.12.1\n"

msgid "N/A"
Expand Down Expand Up @@ -278,13 +278,6 @@ msgstr "استقبلت سؤالًا"
msgid "Your question has been received, you will be notified when it is answered."
msgstr ""

#, fuzzy
msgid "Print job received"
msgstr "استقبلت سؤالًا"

msgid "Your print job has been received."
msgstr ""

msgid "Submission received"
msgstr "التسليم استقبل"

Expand Down Expand Up @@ -334,33 +327,6 @@ msgstr "الوقت المستغرق للتنفيذ"
msgid "Executed"
msgstr "نُفّذ"

msgid "Too many print jobs!"
msgstr ""

#, python-format
msgid "You have reached the maximum limit of at most %d print jobs."
msgstr ""

#, fuzzy
msgid "Invalid format!"
msgstr "ملف غير صالح"

msgid "Please select the correct files."
msgstr ""

msgid "File too big!"
msgstr "ملف ضخم جدًا!"

#, python-format
msgid "Each file must be at most %d bytes long."
msgstr ""

msgid "Print job storage failed!"
msgstr ""

msgid "Please try again."
msgstr "فضلًا جرب مرة أخرى."

msgid "Too many submissions!"
msgstr "كثرت تسليمات!"

Expand Down Expand Up @@ -404,10 +370,16 @@ msgstr ""
msgid "Invalid submission format!"
msgstr "التسليمات الرسمية"

msgid "Please select the correct files."
msgstr ""

#, fuzzy
msgid "Submission storage failed!"
msgstr "تسليم جدًا ضخم!"

msgid "Please try again."
msgstr "فضلًا جرب مرة أخرى."

#, fuzzy
msgid "Too many tests!"
msgstr "كثرت تسليمات!"
Expand Down Expand Up @@ -562,9 +534,6 @@ msgstr "دليل الاستخدام"
msgid "Testing"
msgstr "الأسئلة"

msgid "Printing"
msgstr "طباعة"

msgid "Contest Management System"
msgstr "نظام إدارة المسابقات"

Expand Down Expand Up @@ -741,7 +710,7 @@ msgstr "لقد بدأت إطارك الزمني في %(start_time)s"
msgid "There's nothing you can do now."
msgstr "لا يمكنك فعل شيء."

#, fuzzy, python-format
#, fuzzy
msgid "You never started your time frame. Now it's too late."
msgstr "لقد بدأت إطارك الزمني في %(start_time)s"

Expand Down Expand Up @@ -778,51 +747,6 @@ msgstr "نعم"
msgid "No"
msgstr "لا"

msgid "Print"
msgstr "اطبع"

#, python-format
msgid "You can print %(remaining_jobs)s more text or PDF files of up to %(max_pages)s pages each."
msgstr "يمكنك طباعة %(remaining_jobs)s ملفات نصية أو PDF زيادة، وكل منها لا يتجاوز %(max_pages)s صفحات."

#, fuzzy, python-format
msgid "You can print %(remaining_jobs)s more text files of up to %(max_pages)s pages each."
msgstr "يمكنك طباعة %(remaining_jobs)s ملفات نصية أو PDF زيادة، وكل منها لا يتجاوز %(max_pages)s صفحات."

msgid "File (text or PDF)"
msgstr "ملف (نصي أو PDF)"

msgid "File (text)"
msgstr "ملف (نصي)"

msgid "Submit"
msgstr "تسليم"

msgid "You cannot print anything any more as you have used up your printing quota."
msgstr ""

msgid "Previous print jobs"
msgstr ""

msgid "Date and time"
msgstr "التاريخ والوقت"

msgid "Time"
msgstr "الوقت"

msgid "File name"
msgstr "اسم الملف"

msgid "Status"
msgstr "الحالة"

msgid "Preparing..."
msgstr "يجهز..."

#, fuzzy
msgid "no print jobs yet"
msgstr "لا إجابة بعد"

msgid "The passwords do not match!"
msgstr "كلمتي المرور غير متطابقة!"

Expand Down Expand Up @@ -963,6 +887,9 @@ msgstr "غير معروف"
msgid "loading..."
msgstr "يحمل..."

msgid "Error loading details, please refresh the page."
msgstr ""

#, fuzzy, python-format
msgid "%(name)s (%(short_name)s) <small>submissions</small>"
msgstr "%(name)s (%(short_name)s) <small>الوصف</small>"
Expand Down Expand Up @@ -990,6 +917,9 @@ msgstr "يمكنك أن تسلم أي جزء من المخرجات في التس
msgid "You can submit %(submissions_left)s more solution(s)."
msgstr "يمكنك تسليم %(submissions)s حلول بحد أقصى أثناء المسابقة"

msgid "Submit"
msgstr "تسليم"

msgid "submission.zip"
msgstr "submission.zip"

Expand Down Expand Up @@ -1057,6 +987,15 @@ msgstr "المدخلات"
msgid "Previous tests"
msgstr "التسليمات السابقة"

msgid "Date and time"
msgstr "التاريخ والوقت"

msgid "Time"
msgstr "الوقت"

msgid "Status"
msgstr "الحالة"

msgid "Input"
msgstr "المدخلات"

Expand Down Expand Up @@ -1090,14 +1029,3 @@ msgstr ""
msgid "Your request has been discarded because you already used a token on that submission."
msgstr ""

msgid "Invalid file"
msgstr "ملف غير صالح"

msgid "Print job has too many pages"
msgstr ""

msgid "Sent to printer"
msgstr ""

#~ msgid "Standard Template Library"
#~ msgstr "المكتبة الأساسية"
Loading