Skip to content

Commit cbb6e10

Browse files
committed
Remove PrintingService
1 parent 42aded3 commit cbb6e10

File tree

53 files changed

+2291
-3284
lines changed

Some content is hidden

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

53 files changed

+2291
-3284
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)

0 commit comments

Comments
 (0)