@@ -174,7 +174,7 @@ which is the most commonly used plugin category.
174
174
175
175
Every plugin needs to overwrite ``name `` so voilà, here's our first plugin!
176
176
177
- .. literalinclude :: ../../../trinity/ plugins/examples/peer_count_reporter/plugin.py
177
+ .. literalinclude :: ../../../trinity-external- plugins/examples/peer_count_reporter/peer_count_reporter_plugin /plugin.py
178
178
:language: python
179
179
:pyobject: PeerCountReporterPlugin
180
180
:end-before: def configure_parser
@@ -196,7 +196,7 @@ command line arguments in many different ways.
196
196
197
197
For example, here we are adding a boolean flag ``--report-peer-count `` to Trinity.
198
198
199
- .. literalinclude :: ../../../trinity/ plugins/examples/peer_count_reporter/plugin.py
199
+ .. literalinclude :: ../../../trinity-external- plugins/examples/peer_count_reporter/peer_count_reporter_plugin /plugin.py
200
200
:language: python
201
201
:pyobject: PeerCountReporterPlugin.configure_parser
202
202
@@ -236,14 +236,14 @@ While it is absolutely possible to put this logic right into the plugin, the pre
236
236
subclass :class: `~p2p.service.BaseService ` and implement the core logic in such a standalone
237
237
service.
238
238
239
- .. literalinclude :: ../../../trinity/ plugins/examples/peer_count_reporter/plugin.py
239
+ .. literalinclude :: ../../../trinity-external- plugins/examples/peer_count_reporter/peer_count_reporter_plugin /plugin.py
240
240
:language: python
241
241
:pyobject: PeerCountReporter
242
242
243
243
Then, the implementation of :meth: `~trinity.extensibility.plugin.BaseIsolatedPlugin.do_start ` is
244
244
only concerned about running the service on a fresh event loop.
245
245
246
- .. literalinclude :: ../../../trinity/ plugins/examples/peer_count_reporter/plugin.py
246
+ .. literalinclude :: ../../../trinity-external- plugins/examples/peer_count_reporter/peer_count_reporter_plugin /plugin.py
247
247
:language: python
248
248
:pyobject: PeerCountReporterPlugin.do_start
249
249
@@ -270,7 +270,7 @@ Hence, to actually start a plugin, the plugin needs to invoke the
270
270
``READY `` state. Let's assume a simple case in which we simply want to start the plugin if Trinity
271
271
is started with the ``--report-peer-count `` flag.
272
272
273
- .. literalinclude :: ../../../trinity/ plugins/examples/peer_count_reporter/plugin.py
273
+ .. literalinclude :: ../../../trinity-external- plugins/examples/peer_count_reporter/peer_count_reporter_plugin /plugin.py
274
274
:language: python
275
275
:pyobject: PeerCountReporterPlugin.on_ready
276
276
@@ -325,11 +325,11 @@ In this guide, we won't go into details about how to create Python packages as t
325
325
Once we have a ``setup.py `` file, all we have to do is to expose our plugin under
326
326
``trinity.plugins `` via the ``entry_points `` section.
327
327
328
- .. literalinclude :: ../../../tests/ trinity/integration/trinity_test_plugin /setup.py
328
+ .. literalinclude :: ../../../trinity-external-plugins/examples/peer_count_reporter /setup.py
329
329
:language: python
330
330
331
331
Check out the `official documentation on entry points <https://packaging.python.org/guides/creating-and-discovering-plugins/#using-package-metadata >`_
332
332
for a deeper explanation.
333
333
334
334
A plugin where the ``setup.py `` file is configured as described can be installed by
335
- ``pip install <package-name>` `` and is immediately available as a plugin in Trinity.
335
+ ``pip install <package-name>` `` and immediately becomes available as a plugin in Trinity.
0 commit comments