Skip to content

Commit 01bb884

Browse files
committed
Revert Attchment tutorial to old state.
* works/tested in notebook
1 parent eb9163a commit 01bb884

File tree

5 files changed

+11
-25
lines changed

5 files changed

+11
-25
lines changed

libs/aries-basic-controller/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ python-dotenv
77
termcolor
88
pillow
99
qrcode
10-
beautifulsoup4
11-
pytest~=6.2.3
10+
beautifulsoup4
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
from aries_basic_controller.aries_controller import AriesAgentController
22
from .protocol_controller import ProtocolController
33

4-
from dataclasses import dataclass
54

6-
7-
@dataclass
85
class AttachmentController(AriesAgentController):
96

10-
def __post_init__(self):
11-
super().__post_init__()
7+
def __init__(self, webhook_host: str, webhook_port: int, admin_url: str, webhook_base: str = "",
8+
connections: bool = True, messaging: bool = True, issuer: bool = True, api_key = None):
9+
super().__init__(webhook_host, webhook_port, admin_url, webhook_base,
10+
connections, messaging, issuer, api_key=api_key)
1211

13-
self.protocol = ProtocolController(
14-
self.admin_url, self.client_session, self.connections)
12+
self.protocol = ProtocolController(admin_url, self.client_session, self.connections)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
aries-basic-controller>=0.4
1+
aries-basic-controller<0.3

tutorials/3. Attachments/notebooks/alice/attachment.ipynb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,7 @@
4545
"API_KEY = \"alice_api_123456789\"\n",
4646
"\n",
4747
"# Based on the aca-py agent you wish to control\n",
48-
"attach_controller = AttachmentController(admin_url=ADMIN_URL, api_key=API_KEY)"
49-
]
50-
},
51-
{
52-
"cell_type": "code",
53-
"execution_count": null,
54-
"metadata": {},
55-
"outputs": [],
56-
"source": [
57-
"attach_controller.init_webhook_server(webhook_host=WEBHOOK_HOST,\n",
58-
" webhook_port=WEBHOOK_PORT,\n",
59-
" webhook_base=WEBHOOK_BASE)"
48+
"attach_controller = AttachmentController(admin_url=ADMIN_URL, api_key=API_KEY, webhook_host=WEBHOOK_HOST, webhook_port=WEBHOOK_PORT, webhook_base=WEBHOOK_BASE)"
6049
]
6150
},
6251
{

tutorials/3. Attachments/notebooks/bob/attachment.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"ADMIN_URL = \"http://bob-agent:8051\"\n",
3838
"\n",
3939
"# Based on the aca-py agent you wish to control\n",
40-
"attach_controller = AttachmentController(admin_url=ADMIN_URL)"
40+
"attach_controller = AttachmentController(admin_url=ADMIN_URL, webhook_host=WEBHOOK_HOST, webhook_base=WEBHOOK_BASE, webhook_port=WEBHOOK_PORT)"
4141
]
4242
},
4343
{
@@ -103,7 +103,7 @@
103103
"# fh = open(\"image_received.png\", \"wb\")\n",
104104
"# fh.write(text)\n",
105105
"# fh.close()\n",
106-
" filepath = f\"received_files/{filename}\"\n",
106+
" filepath = f\"{filename}\"\n",
107107
" f = open(filepath,'wb')\n",
108108
" f.write(file_content)\n",
109109
" f.close()\n",
@@ -133,7 +133,7 @@
133133
"outputs": [],
134134
"source": [
135135
"response = await attach_controller.terminate()\n",
136-
"print(response)\n"
136+
"print(response)"
137137
]
138138
},
139139
{

0 commit comments

Comments
 (0)