Skip to content

Commit 62bd2df

Browse files
committed
Remove PrintingService
1 parent 42aded3 commit 62bd2df

File tree

57 files changed

+656
-3516
lines changed

Some content is hidden

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

57 files changed

+656
-3516
lines changed

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-02 02:09+0100\n"
67
"PO-Revision-Date: 2025-08-20 09:02+0000\n"
78
"Last-Translator: Muaath Alqarni <[email protected]>\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.13\n"
1515
"Generated-By: Babel 2.12.1\n"
1616

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

285-
#, fuzzy
286-
msgid "Print job received"
287-
msgstr "استقبلت سؤالًا"
288-
289-
msgid "Your print job has been received."
290-
msgstr ""
291-
292285
msgid "Submission received"
293286
msgstr "التسليم استقبل"
294287

@@ -338,33 +331,6 @@ msgstr "الوقت المستغرق للتنفيذ"
338331
msgid "Executed"
339332
msgstr "نُفّذ"
340333

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

@@ -408,10 +374,16 @@ msgstr ""
408374
msgid "Invalid submission format!"
409375
msgstr "التسليمات الرسمية"
410376

377+
msgid "Please select the correct files."
378+
msgstr ""
379+
411380
#, fuzzy
412381
msgid "Submission storage failed!"
413382
msgstr "تسليم جدًا ضخم!"
414383

384+
msgid "Please try again."
385+
msgstr "فضلًا جرب مرة أخرى."
386+
415387
#, fuzzy
416388
msgid "Too many tests!"
417389
msgstr "كثرت تسليمات!"
@@ -566,9 +538,6 @@ msgstr "دليل الاستخدام"
566538
msgid "Testing"
567539
msgstr "الأسئلة"
568540

569-
msgid "Printing"
570-
msgstr "طباعة"
571-
572541
msgid "Contest Management System"
573542
msgstr "نظام إدارة المسابقات"
574543

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

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

@@ -782,51 +751,6 @@ msgstr "نعم"
782751
msgid "No"
783752
msgstr "لا"
784753

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

@@ -967,6 +891,9 @@ msgstr "غير معروف"
967891
msgid "loading..."
968892
msgstr "يحمل..."
969893

894+
msgid "Error loading details, please refresh the page."
895+
msgstr ""
896+
970897
#, fuzzy, python-format
971898
msgid "%(name)s (%(short_name)s) <small>submissions</small>"
972899
msgstr "%(name)s (%(short_name)s) <small>الوصف</small>"
@@ -994,6 +921,9 @@ msgstr "يمكنك أن تسلم أي جزء من المخرجات في التس
994921
msgid "You can submit %(submissions_left)s more solution(s)."
995922
msgstr "يمكنك تسليم %(submissions)s حلول بحد أقصى أثناء المسابقة"
996923

924+
msgid "Submit"
925+
msgstr "تسليم"
926+
997927
msgid "submission.zip"
998928
msgstr "submission.zip"
999929

@@ -1061,6 +991,15 @@ msgstr "المدخلات"
1061991
msgid "Previous tests"
1062992
msgstr "التسليمات السابقة"
1063993

994+
msgid "Date and time"
995+
msgstr "التاريخ والوقت"
996+
997+
msgid "Time"
998+
msgstr "الوقت"
999+
1000+
msgid "Status"
1001+
msgstr "الحالة"
1002+
10641003
msgid "Input"
10651004
msgstr "المدخلات"
10661005

@@ -1094,14 +1033,3 @@ msgstr ""
10941033
msgid "Your request has been discarded because you already used a token on that submission."
10951034
msgstr ""
10961035

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

0 commit comments

Comments
 (0)