52 lines
1.7 KiB
Plaintext
52 lines
1.7 KiB
Plaintext
![]() |
Title: User's Guide:i2p.router
|
||
|
|
||
|
Module <code>i2p.router</code> allows Python programs to control the I2P router.
|
||
|
|
||
|
== Functions ==
|
||
|
|
||
|
'''check'''(dir=None)
|
||
|
<ul><pre>
|
||
|
Checks whether a locally installed router is running. Does
|
||
|
nothing if successful, otherwise raises i2p.RouterError.
|
||
|
|
||
|
An I2P installation is located by using find(dir).
|
||
|
The router.config file is parsed for 'router.adminPort'.
|
||
|
This port is queried to determine whether the router is
|
||
|
running.
|
||
|
</pre></ul>
|
||
|
'''find'''(dir=None)
|
||
|
<ul><pre>
|
||
|
Find the absolute path to a locally installed I2P router.
|
||
|
|
||
|
An I2P installation is located by looking in the
|
||
|
environment I2P, then in PATH, then in the dir argument
|
||
|
given to the function. It looks for startRouter.sh or
|
||
|
startRouter.bat. Raises ValueError if an I2P installation
|
||
|
could not be located.
|
||
|
</pre></ul>
|
||
|
'''start'''(dir=None, hidden=False)
|
||
|
<ul><pre>
|
||
|
Start a locally installed I2P router. Does nothing if
|
||
|
the router has already been started.
|
||
|
|
||
|
An I2P installation is located by using find(dir).
|
||
|
|
||
|
If hidden is True, do not show a terminal for the router.
|
||
|
</pre></ul>
|
||
|
'''stop'''(dir=None, force=False)
|
||
|
<ul><pre>
|
||
|
Stop a locally installed I2P router, if it was started by
|
||
|
the current Python program. If force is True, stop the
|
||
|
router even if it was started by another process. Do nothing
|
||
|
if force is False and the router was started by another program.
|
||
|
|
||
|
The file 'router.config' is located using the same search
|
||
|
process used for find(dir). It is parsed for
|
||
|
'router.shutdownPassword' and 'router.adminPort'. The
|
||
|
router is shut down through the admin port.
|
||
|
|
||
|
Raises i2p.RouterError if the I2P router is running but cannot
|
||
|
be stopped. You must uncomment the
|
||
|
'router.shutdownPassword' line for this command to work.
|
||
|
</pre></ul>
|