Skip to content

Commit 1aa8493

Browse files
committed
sunc and update webapp 16-10
1 parent f49764c commit 1aa8493

26 files changed

Lines changed: 3782 additions & 2907 deletions

exporter/webapp/data_classes.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
from db.models import DpdRoot, Lookup
1+
from db.models import DpdHeadword, DpdRoot, Lookup
22
from tools.configger import config_test
33
from tools.date_and_time import year_month_day_dash
4-
from tools.degree_of_completion import degree_of_completion
54
from tools.meaning_construction import (
65
make_grammar_line,
7-
make_meaning_combo_html,
8-
summarize_construction,
96
)
107

118

129
class HeadwordData:
13-
def __init__(self, i, fc, fi, fs):
14-
self.meaning = make_meaning_combo_html(i)
15-
self.summary = summarize_construction(i)
16-
self.complete = degree_of_completion(i)
10+
def __init__(self, i: DpdHeadword, fc, fi, fs):
11+
self.meaning = i.meaning_combo_html
12+
self.summary = i.construction_summary
13+
self.complete = i.degree_of_completion_html
1714
self.grammar = make_grammar_line(i)
1815
self.i = self.convert_newlines(i)
1916
self.fc = fc

exporter/webapp/data_classes_ru.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from db.models import DpdRoot, Lookup
1+
from db.models import DpdHeadword, DpdRoot, Lookup
22
from tools.tools_for_ru_exporter import (
33
make_ru_meaning,
44
ru_make_grammar_line,
@@ -8,14 +8,13 @@
88
from tools.configger import config_test
99
from tools.date_and_time import year_month_day_dash
1010
from tools.degree_of_completion_ru import rus_degree_of_completion
11-
from tools.meaning_construction import summarize_construction, make_meaning_combo_html
1211

1312

1413
class HeadwordData:
15-
def __init__(self, i, fc, fi, fs):
16-
self.meaning = make_meaning_combo_html(i)
14+
def __init__(self, i: DpdHeadword, fc, fi, fs):
15+
self.meaning = i.meaning_combo_html
1716
self.ru_meaning = make_ru_meaning(i)
18-
self.summary = summarize_construction(i)
17+
self.summary = i.construction_summary
1918
self.rus_complete = rus_degree_of_completion(i)
2019
self.ru_grammar = ru_make_grammar_line(i)
2120
self.ru_pos = ru_replace_abbreviations(i.pos, "gram")

exporter/webapp/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
from contextlib import contextmanager
23
import re
34

@@ -222,7 +223,7 @@ def update_history(
222223
if history_tuple in history_list:
223224
history_list.remove(history_tuple)
224225
history_list.insert(0, history_tuple)
225-
return history_list[:25]
226+
return history_list[:250]
226227

227228

228229
if __name__ == "__main__":

exporter/webapp/main_ru.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def update_history(
310310
if history_tuple in history_list:
311311
history_list.remove(history_tuple)
312312
history_list.insert(0, history_tuple)
313-
return history_list[:25]
313+
return history_list[:250]
314314

315315

316316
if __name__ == "__main__":

exporter/webapp/ru_templates/deconstructor.html

100755100644
Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
<h3>деконструктор: {{d.headword}}</h3>
2-
<div class='dpd'>
3-
<p>
4-
{% for deconstruction in d.deconstructions: %}
5-
{{deconstruction}}
6-
{% if not loop.last: %}
7-
<br>
8-
{% endif %}
9-
{% endfor %}
10-
</p>
11-
<p class='footer'>
12-
Эти разбиения слов создаются автоматически. <a class="link" href="https://docs.google.com/forms/d/1iMD9sCSWFfJAFCFYuG9HRIyrr9KFRy0nAOVApM998wM/viewform?usp=pp_url&entry.438735500={{d.lookup_key}}&entry.326955045=Деконструктор&entry.1433863141={{d.app_name}}+{{d.date}}" target="_blank">Предложения приветствуются здесь.</a>
13-
<br>Ошибки в деконструкции обычно вызваны отсутствием слова в словаре. <a class="link" href="https://docs.google.com/forms/d/e/1FAIpQLSfResxEUiRCyFITWPkzoQ2HhHEvUS5fyg68Rl28hFH6vhHlaA/viewform?usp=pp_url&entry.1433863141={{d.app_name}}+{{d.date}}" target="_blank">Добавьте отсутствующие слова здесь</a>.
14-
</p>
2+
<div class="dpd">
3+
<p>
4+
{% for deconstruction in d.deconstructions: %} {{deconstruction}} {% if not
5+
loop.last: %}
6+
<br />
7+
{% endif %} {% endfor %}
8+
</p>
9+
<p class="footer">
10+
Эти разбиения слов создаются автоматически. Подробнее
11+
<a
12+
class="link"
13+
href="https://https://devamitta.github.io/dpd.rus/features/deconstructor/"
14+
target="_blank">в документации</a>. Предложения приветствуются
15+
<a
16+
class="link"
17+
href="https://docs.google.com/forms/d/1iMD9sCSWFfJAFCFYuG9HRIyrr9KFRy0nAOVApM998wM/viewform?usp=pp_url&entry.438735500={{d.headword}}&entry.326955045=Деконструктор&entry.1433863141={{d.app_name}}+{{d.date}}"
18+
target="_blank">здесь</a>. Ошибки в деконструкции обычно вызваны отсутствием слова в словаре. Вы можете
19+
<a
20+
class="link"
21+
href="https://docs.google.com/forms/d/e/1FAIpQLSfResxEUiRCyFITWPkzoQ2HhHEvUS5fyg68Rl28hFH6vhHlaA/viewform?usp=pp_url&entry.1433863141={{d.app_name}}+{{d.date}}"
22+
target="_blank">добавить отсутствующие слова здесь</a>.
23+
</p>
1524
</div>

0 commit comments

Comments
 (0)