Skip to content

Commit 7e94024

Browse files
authored
Remove PrintingService (#1583)
1 parent feb9906 commit 7e94024

File tree

58 files changed

+683
-3525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+683
-3525
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
2323
ghc
2424
git
2525
libcap-dev
26-
libcups2-dev
2726
libffi-dev
2827
libpq-dev
2928
libyaml-dev

cms/conf.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,6 @@ class ProxyServiceConfig:
147147
https_certfile: str | None = None
148148

149149

150-
@dataclass()
151-
class PrintingServiceConfig:
152-
max_print_length: int = 10_000_000 # 10 MB
153-
printer: str | None = None
154-
paper_size: str = "A4"
155-
max_pages_per_job: int = 10
156-
max_jobs_per_user: int = 10
157-
pdf_printing_allowed: bool = False
158-
159-
160150
@dataclass()
161151
class PrometheusConfig:
162152
listen_address: str = "127.0.0.1"
@@ -186,7 +176,6 @@ class Config:
186176
contest_web_server: CWSConfig = field_helper(CWSConfig)
187177
admin_web_server: AWSConfig = field_helper(AWSConfig)
188178
proxy_service: ProxyServiceConfig = field_helper(ProxyServiceConfig)
189-
printing: PrintingServiceConfig = field_helper(PrintingServiceConfig)
190179
prometheus: PrometheusConfig = field_helper(PrometheusConfig)
191180
telegram_bot: TelegramBotConfig | None = None
192181
# This is the one that will be provided in the config file.

cms/db/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@
6666
# usertest
6767
"UserTest", "UserTestFile", "UserTestManager", "UserTestResult",
6868
"UserTestExecutable",
69-
# printjob
70-
"PrintJob",
7169
# init
7270
"init_db",
7371
# drop
@@ -81,7 +79,7 @@
8179

8280
# Instantiate or import these objects.
8381

84-
version = 46
82+
version = 47
8583

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

108105
from .init import init_db
109106
from .drop import drop_db

cms/db/printjob.py

Lines changed: 0 additions & 75 deletions
This file was deleted.

cms/db/user.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from . import CastingArray, Codename, Base, Admin, Contest
4040
import typing
4141
if typing.TYPE_CHECKING:
42-
from . import PrintJob, Submission, UserTest
42+
from . import Submission, UserTest
4343

4444
class User(Base):
4545
"""Class to store a user.
@@ -271,12 +271,6 @@ class Participation(Base):
271271
passive_deletes=True,
272272
back_populates="participation")
273273

274-
printjobs: list["PrintJob"] = relationship(
275-
"PrintJob",
276-
cascade="all, delete-orphan",
277-
passive_deletes=True,
278-
back_populates="participation")
279-
280274

281275
class Message(Base):
282276
"""Class to store a private message from the managers to the

cms/db/util.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
UserTestManager,
5252
UserTestResult,
5353
UserTestExecutable,
54-
PrintJob,
5554
Session,
5655
)
5756

@@ -309,7 +308,6 @@ def enumerate_files(
309308
skip_submissions=False,
310309
skip_user_tests=False,
311310
skip_users=False,
312-
skip_print_jobs=False,
313311
skip_generated=False,
314312
) -> set[str]:
315313
"""Enumerate all the files (by digest) referenced by the
@@ -363,11 +361,6 @@ def enumerate_files(
363361
.filter(UserTestResult.output != None)
364362
.with_entities(UserTestResult.output))
365363

366-
if not skip_print_jobs and not skip_users:
367-
queries.append(contest_q.join(Contest.participations)
368-
.join(Participation.printjobs)
369-
.with_entities(PrintJob.digest))
370-
371364
# union(...).execute() would be executed outside of the session.
372365
digests = set(r[0] for r in session.execute(union(*queries)))
373366
digests.discard(Digest.TOMBSTONE)

cms/locale/ar/LC_MESSAGES/cms.po

Lines changed: 27 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1+
12
msgid ""
23
msgstr ""
3-
"Project-Id-Version: VERSION\n"
4+
"Project-Id-Version: VERSION\n"
45
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
5-
"POT-Creation-Date: 2025-08-16 14:52+0300\n"
6+
"POT-Creation-Date: 2025-11-09 23:31+0100\n"
67
"PO-Revision-Date: 2025-10-07 18:02+0000\n"
78
"Last-Translator: Muaath Alqarni <translate@muaath.dev>\n"
8-
"Language-Team: Arabic <https://hosted.weblate.org/projects/cms/main/ar/>\n"
99
"Language: ar\n"
10+
"Language-Team: Arabic <https://hosted.weblate.org/projects/cms/main/ar/>\n"
11+
"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"
1012
"MIME-Version: 1.0\n"
1113
"Content-Type: text/plain; charset=utf-8\n"
1214
"Content-Transfer-Encoding: 8bit\n"
13-
"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"
14-
"X-Generator: Weblate 5.14-dev\n"
1515
"Generated-By: Babel 2.12.1\n"
1616

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

281-
#, fuzzy
282-
msgid "Print job received"
283-
msgstr "استقبلت سؤالًا"
284-
285-
msgid "Your print job has been received."
286-
msgstr ""
287-
288281
msgid "Submission received"
289282
msgstr "التسليم استقبل"
290283

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

337-
msgid "Too many print jobs!"
338-
msgstr ""
339-
340-
#, python-format
341-
msgid "You have reached the maximum limit of at most %d print jobs."
342-
msgstr ""
343-
344-
#, fuzzy
345-
msgid "Invalid format!"
346-
msgstr "ملف غير صالح"
347-
348-
msgid "Please select the correct files."
349-
msgstr ""
350-
351-
msgid "File too big!"
352-
msgstr "ملف ضخم جدًا!"
353-
354-
#, python-format
355-
msgid "Each file must be at most %d bytes long."
356-
msgstr ""
357-
358-
msgid "Print job storage failed!"
359-
msgstr ""
360-
361-
msgid "Please try again."
362-
msgstr "فضلًا جرب مرة أخرى."
363-
364330
msgid "Too many submissions!"
365331
msgstr "كثرت تسليمات!"
366332

@@ -404,10 +370,16 @@ msgstr ""
404370
msgid "Invalid submission format!"
405371
msgstr "التسليمات الرسمية"
406372

373+
msgid "Please select the correct files."
374+
msgstr ""
375+
407376
#, fuzzy
408377
msgid "Submission storage failed!"
409378
msgstr "تسليم جدًا ضخم!"
410379

380+
msgid "Please try again."
381+
msgstr "فضلًا جرب مرة أخرى."
382+
411383
#, fuzzy
412384
msgid "Too many tests!"
413385
msgstr "كثرت تسليمات!"
@@ -562,9 +534,6 @@ msgstr "دليل الاستخدام"
562534
msgid "Testing"
563535
msgstr "الأسئلة"
564536

565-
msgid "Printing"
566-
msgstr "طباعة"
567-
568537
msgid "Contest Management System"
569538
msgstr "نظام إدارة المسابقات"
570539

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

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

@@ -778,51 +747,6 @@ msgstr "نعم"
778747
msgid "No"
779748
msgstr "لا"
780749

781-
msgid "Print"
782-
msgstr "اطبع"
783-
784-
#, python-format
785-
msgid "You can print %(remaining_jobs)s more text or PDF files of up to %(max_pages)s pages each."
786-
msgstr "يمكنك طباعة %(remaining_jobs)s ملفات نصية أو PDF زيادة، وكل منها لا يتجاوز %(max_pages)s صفحات."
787-
788-
#, fuzzy, python-format
789-
msgid "You can print %(remaining_jobs)s more text files of up to %(max_pages)s pages each."
790-
msgstr "يمكنك طباعة %(remaining_jobs)s ملفات نصية أو PDF زيادة، وكل منها لا يتجاوز %(max_pages)s صفحات."
791-
792-
msgid "File (text or PDF)"
793-
msgstr "ملف (نصي أو PDF)"
794-
795-
msgid "File (text)"
796-
msgstr "ملف (نصي)"
797-
798-
msgid "Submit"
799-
msgstr "تسليم"
800-
801-
msgid "You cannot print anything any more as you have used up your printing quota."
802-
msgstr ""
803-
804-
msgid "Previous print jobs"
805-
msgstr ""
806-
807-
msgid "Date and time"
808-
msgstr "التاريخ والوقت"
809-
810-
msgid "Time"
811-
msgstr "الوقت"
812-
813-
msgid "File name"
814-
msgstr "اسم الملف"
815-
816-
msgid "Status"
817-
msgstr "الحالة"
818-
819-
msgid "Preparing..."
820-
msgstr "يجهز..."
821-
822-
#, fuzzy
823-
msgid "no print jobs yet"
824-
msgstr "لا إجابة بعد"
825-
826750
msgid "The passwords do not match!"
827751
msgstr "كلمتي المرور غير متطابقة!"
828752

@@ -963,6 +887,9 @@ msgstr "غير معروف"
963887
msgid "loading..."
964888
msgstr "يحمل..."
965889

890+
msgid "Error loading details, please refresh the page."
891+
msgstr ""
892+
966893
#, fuzzy, python-format
967894
msgid "%(name)s (%(short_name)s) <small>submissions</small>"
968895
msgstr "%(name)s (%(short_name)s) <small>الوصف</small>"
@@ -990,6 +917,9 @@ msgstr "يمكنك أن تسلم أي جزء من المخرجات في التس
990917
msgid "You can submit %(submissions_left)s more solution(s)."
991918
msgstr "يمكنك تسليم %(submissions)s حلول بحد أقصى أثناء المسابقة"
992919

920+
msgid "Submit"
921+
msgstr "تسليم"
922+
993923
msgid "submission.zip"
994924
msgstr "submission.zip"
995925

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

990+
msgid "Date and time"
991+
msgstr "التاريخ والوقت"
992+
993+
msgid "Time"
994+
msgstr "الوقت"
995+
996+
msgid "Status"
997+
msgstr "الحالة"
998+
1060999
msgid "Input"
10611000
msgstr "المدخلات"
10621001

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

1093-
msgid "Invalid file"
1094-
msgstr "ملف غير صالح"
1095-
1096-
msgid "Print job has too many pages"
1097-
msgstr ""
1098-
1099-
msgid "Sent to printer"
1100-
msgstr ""
1101-
1102-
#~ msgid "Standard Template Library"
1103-
#~ msgstr "المكتبة الأساسية"

0 commit comments

Comments
 (0)