mt5-manager/docs/publish/code/13_python.txt
Yuriy Bykov Yuriy Bykov 97a0ec37d4 Prepare article part 4 for publication
Article:
- rename the deployment section to "Развёртывание через config/services.ini"
- keep only first-level sections in the table of contents, drop the
  archive entry
- add the warning block and the archive table in the series format
- rename screenshots to meaningful English names

Publishing helpers (docs/publish):
- build_article_html.py builds the HTML fragment for the site editor with
  anchored headings, linked table of contents, captions and code blocks
- code/ holds each code block as a separate file, description.txt the
  short description

Code:
- static/script.js: bump version to 0.3.0

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 23:43:05 +03:00
13 lines
647 B
Text
def read_state(self, folder: str) -> sqlite3.Row | None:
try:
con = sqlite3.connect(self.database, timeout=3)
con.row_factory = sqlite3.Row
try:
return con.execute(self.STATE_QUERY, (folder,)).fetchone()
finally:
con.close()
except sqlite3.OperationalError as e:
# База ещё не создана, занята или не совпадает схема - идём дальше
# без данных, но причину печатаем, чтобы она не оставалась скрытой
print(f'read_state({folder!r}): {e}')
return None