Skip to content

Commit 459ae61

Browse files
committed
Replace SGI STL doc with cppreference.com offline copy
1 parent 4a6159b commit 459ae61

File tree

7 files changed

+11
-31
lines changed

7 files changed

+11
-31
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ addons:
2525
- fp-units-rtl
2626
- postgresql-client
2727
- python2.7
28-
- stl-manual
28+
- cppreference-doc-en-html
2929
- cgroup-lite
3030
- libcap-dev
3131
- python-dev

cms/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def __init__(self):
136136
self.num_proxies_used = None
137137
self.max_submission_length = 100000
138138
self.max_input_length = 5000000
139-
self.stl_path = "/usr/share/doc/stl-manual/html/"
139+
self.stl_path = "/usr/share/cppreference/doc/html/"
140140
# Prefix of 'shared-mime-info'[1] installation. It can be found
141141
# out using `pkg-config --variable=prefix shared-mime-info`, but
142142
# it's almost universally the same (i.e. '/usr') so it's hardly

cms/server/contest/handlers/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from cms import config
3535

3636
from .base import \
37-
StaticFileGzHandler
37+
StaticFileHandler
3838
from .main import \
3939
LoginHandler, \
4040
LogoutHandler, \
@@ -75,7 +75,7 @@
7575
(r"/notifications", NotificationsHandler),
7676
(r"/printing", PrintingHandler),
7777
(r"/documentation", DocumentationHandler),
78-
(r"/stl/(.*)", StaticFileGzHandler, {"path": config.stl_path}),
78+
(r"/stl/(.*)", StaticFileHandler, {"path": config.stl_path}),
7979

8080
# Tasks
8181

cms/server/contest/handlers/base.py

+2-23
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ def get(self):
179179
**self.r_params)
180180

181181

182-
class StaticFileGzHandler(tornado.web.StaticFileHandler):
183-
"""Handle files which may be gzip-compressed on the filesystem.
182+
class StaticFileHandler(tornado.web.StaticFileHandler):
183+
"""Handle static files in a multi-contest aware way.
184184
185185
"""
186186
def is_multi_contest(self):
@@ -195,24 +195,3 @@ def get_absolute_path(self, root, path_or_contest_name):
195195
else:
196196
# Otherwise, we can just use the second argument.
197197
return os.path.abspath(os.path.join(root, path_or_contest_name))
198-
199-
def validate_absolute_path(self, root, absolute_path):
200-
self.is_gzipped = False
201-
try:
202-
return tornado.web.StaticFileHandler.validate_absolute_path(
203-
self, root, absolute_path)
204-
except tornado.web.HTTPError as e:
205-
if e.status_code != 404:
206-
raise
207-
self.is_gzipped = True
208-
self.absolute_path = \
209-
tornado.web.StaticFileHandler.validate_absolute_path(
210-
self, root, absolute_path + ".gz")
211-
self.set_header("Content-encoding", "gzip")
212-
return self.absolute_path
213-
214-
def get_content_type(self):
215-
if self.is_gzipped:
216-
return "text/plain"
217-
else:
218-
return tornado.web.StaticFileHandler.get_content_type(self)

cms/server/contest/templates/documentation.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h2>{% trans %}Programming languages and libraries{% endtrans %}</h2>
1414
{% if contest.languages|map("to_language")|map(attribute="source_extensions")|any("contains", ".cpp") %}
1515
<h3>C++</h3>
1616

17-
<p><a href="{{ contest_url("stl", "index.html") }}">{% trans %}Standard Template Library{% endtrans %}</a></p>
17+
<p><a href="{{ contest_url("stl", "en", "index.html") }}">{% trans %}Standard Template Library{% endtrans %}</a></p>
1818
{% endif %}
1919

2020
{% if contest.languages|map("to_language")|map(attribute="source_extensions")|any("contains", ".java") %}

config/cms.conf.sample

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"max_input_length": 5000000,
120120

121121
"_help": "STL documentation path in the system (exposed in CWS).",
122-
"stl_path": "/usr/share/doc/stl-manual/html/",
122+
"stl_path": "/usr/share/cppreference/doc/html/",
123123

124124

125125

docs/Installation.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ On Ubuntu 16.04, one will need to run the following script to satisfy all depend
5656
# Feel free to change OpenJDK packages with your preferred JDK.
5757
sudo apt-get install build-essential openjdk-8-jre openjdk-8-jdk \
5858
fp-compiler fp-units-base fp-units-fcl fp-units-misc fp-units-math fp-units-rtl \
59-
postgresql postgresql-client python3.6 stl-manual cgroup-lite libcap-dev
59+
postgresql postgresql-client python3.6 cppreference-doc-en-html cgroup-lite \
60+
libcap-dev
6061

6162
# Only if you are going to use pip/virtualenv to install python dependencies
6263
sudo apt-get install python3.6-dev libpq-dev libcups2-dev libyaml-dev \
@@ -78,7 +79,7 @@ On Arch Linux, unofficial AUR packages can be found: `cms <http://aur.archlinux.
7879

7980
# Install the following from AUR.
8081
# https://aur.archlinux.org/packages/libcgroup/
81-
# https://aur.archlinux.org/packages/sgi-stl-doc/
82+
# https://aur.archlinux.org/packages/cppreference/
8283

8384
# Only if you are going to use pip/virtualenv to install python dependencies
8485
sudo pacman -S --needed postgresql-libs libcups libyaml python-pip

0 commit comments

Comments
 (0)