Commands
This commit is contained in:
parent
aaa3d93224
commit
3334a1de97
48
MininaVD/docs2/data2/commandsCommand.ipynb
Normal file
48
MininaVD/docs2/data2/commandsCommand.ipynb
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "29468b18-8654-4914-a68e-76c1a7f01c49",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from abc import ABC, abstractmethod\n",
|
||||
"\n",
|
||||
"class Command(ABC):\n",
|
||||
" \"\"\"Интерфейс команды (паттерн Command).\"\"\"\n",
|
||||
" \n",
|
||||
" @abstractmethod\n",
|
||||
" def execute(self) -> None:\n",
|
||||
" \"\"\"Выполнить команду.\"\"\"\n",
|
||||
" pass\n",
|
||||
" \n",
|
||||
" @abstractmethod\n",
|
||||
" def undo(self) -> None:\n",
|
||||
" \"\"\"Отменить команду.\"\"\"\n",
|
||||
" pass"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python [conda env:base] *",
|
||||
"language": "python",
|
||||
"name": "conda-base-py"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.13.9"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user