@@ -10,68 +10,77 @@ connections.
1010
1111Make sure ` pppd ` is installed on your system, typically on Ubuntu/Debian:
1212
13- $ apt-get install pppd
13+ ``` shell
14+ $ apt-get install pppd
15+ ```
1416
1517
1618And on Fedora/CentOS/RedHat:
1719
18- $ dnf install pppd
20+ ``` shell
21+ $ dnf install pppd
22+ ```
1923
2024
2125Then you can install the latest release from PyPi:
2226
23- $ pip install python-pppd
27+ ``` shell
28+ $ pip install python-pppd
29+ ```
2430
2531
2632Alternatively, clone and install the latest development version from GitHub:
2733
28- $ git clone https://github.com/cour4g3/python-pppd
29- $ cd python-pppd
30- $ pip install -e .
34+ ``` shell
35+ $ git clone https://github.com/cour4g3/python-pppd
36+ $ cd python-pppd
37+ $ pip install -e .
38+ ```
3139
3240
3341## Getting Started
3442
3543You can connect to an existing configured PPP connection:
3644
37- .. code:: python
38-
39- >>> from pppd import PPPConnection
40- >>> ppp = PPPConnection(call='work' ) # blocks until connected
41- > > > ppp.connected() # check if connected, raises error if connection error
42- True
43- > > > ppp.laddr # address of local host
44- '10.0.0.1'
45- > > > ppp.raddr # address of remote client
46- '10.0.0.2'
45+ ``` python
46+ >> > from pppd import PPPConnection
47+ >> > ppp = PPPConnection( call = ' work ' ) # blocks until connected
48+ >> > ppp.connected( ) # check if connected, raises error if connection error
49+ True
50+ >> > ppp.laddr # address of local host
51+ ' 10.0.0.1 '
52+ >> > ppp.raddr # address of remote client
53+ ' 10.0.0.2 '
54+ ```
4755
4856
4957You can specify any positional or keyword arguments:
5058
51- .. code:: python
52-
53- PPPConnection('/dev/ttyS0', connect='/usr/bin/chat -v -f /etc/chatscripts/A1')
54-
59+ ``` python
60+ >> > PPPConnection(' /dev/ttyS0' , connect = ' /usr/bin/chat -v -f /etc/chatscripts/A1' )
61+ ```
5562
5663Which is equivalent to the following:
5764
58- $ sudo pppd /dev/ttyS0 connect "/usr/bin/chat -v -f /etc/chatscripts/A1"
65+ ``` shell
66+ $ sudo pppd /dev/ttyS0 connect " /usr/bin/chat -v -f /etc/chatscripts/A1"
67+ ```
5968
6069
6170Normally you require ` sudo ` to use ` pppd ` , if you don't have it and have setup
6271the ` pppd ` binary with setuid-root or are running as root you can use:
6372
64- .. code:: python
65-
66- PPPConnection(sudo=False)
73+ ``` python
74+ >> > PPPConnection( sudo = False )
75+ ```
6776
6877
6978You can also specify an alternate paths to ` pppd ` or ` sudo ` if the libary cannot
7079find them:
7180
72- .. code:: python
73-
74- PPPConnection(sudo_path='/usr/local/bin/sudo', pppd_path='/usr/local/sbin/pppd')
81+ ``` python
82+ >> > PPPConnection( sudo_path = ' /usr/local/bin/sudo ' , pppd_path = ' /usr/local/sbin/pppd ' )
83+ ```
7584
7685
7786License
0 commit comments