Skip to content

Commit 09533fe

Browse files
authored
Merge pull request #14 from rodorgas/patch-1
Fix syntax on README
2 parents a290d84 + b6bbe6a commit 09533fe

1 file changed

Lines changed: 39 additions & 17 deletions

File tree

README.rst

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,70 @@
1+
=================
12
foscam-python-lib
23
=================
34

4-
Foscam Python Library for H.264 IP Cameras (FI9821W/P/HD816W/P)
5+
.. image:: https://img.shields.io/pypi/v/pyfoscam.svg
6+
:target: https://pypi.python.org/pypi/pyfoscam
7+
8+
Foscam Python2 Library for H.264 IP Cameras (FI9821W/P/HD816W/P)
59

610
TODO
7-
----
8-
1. Package setup.py and upload to pypi.
9-
2. Support more camera models.
11+
====
12+
13+
1. Support more camera models.
1014

1115
Getting Started
12-
---------------
13-
### Simple example:
16+
===============
17+
18+
Install
19+
-------
20+
21+
22+
.. code:: bash
23+
24+
$ pip install pyfoscam
25+
26+
Simple example
27+
--------------
1428
Here is a simple example to move camera lens up and stop after 1s.
15-
```python
29+
30+
.. code:: python
31+
1632
from foscam import FoscamCamera
1733
from time import sleep
1834
19-
mycam = FoscamCamera('192.168.0.110', 88, 'admin', 'foscam')
35+
mycam = FoscamCamera('192.168.0.110', 88, 'admin', 'pwd')
2036
mycam.ptz_move_up()
2137
sleep(1)
2238
mycam.ptz_stop_run()
23-
```
2439
25-
### Asynchronous feature:
40+
Asynchronous feature
41+
--------------------
2642
This example uses the asynchronous feature provided by ``FoscamCamera``.
43+
2744
Normally, a command is sent synchronously, waiting for results and blocking the main thread.
45+
2846
By initializing ``FoscamCamera`` with `daemon=True` (defaults to False), commands are sent asynchronously.
29-
```python
30-
mycam = FoscamCamera('192.168.0.110', 88, 'admin', 'foscam', daemon=True)
47+
48+
.. code:: python
49+
50+
mycam = FoscamCamera('192.168.0.110', 88, 'admin', 'pwd', daemon=True)
3151
mycam.get_ip_info()
3252
mycam.get_port_info()
3353
mycam.refresh_wifi_list()
34-
```
3554
36-
### Send command with callback:
55+
56+
Send command with callback
57+
--------------------------
3758
This example illustrates the use of a callback function when the command completes.
38-
```python
59+
60+
.. code:: python
61+
3962
from foscam import FoscamCamera, FOSCAM_SUCCESS
4063
def print_ipinfo(returncode, params):
4164
if returncode != FOSCAM_SUCCESS:
4265
print 'Failed to get IPInfo!'
4366
return
4467
print 'IP: %s, Mask: %s' % (params['ip'], params['mask'])
4568
46-
mycam = FoscamCamera('192.168.0.110', 88, 'admin', 'foscam', daemon=False)
69+
mycam = FoscamCamera('192.168.0.110', 88, 'admin', 'pwd', daemon=False)
4770
mycam.get_ip_info(print_ipinfo)
48-
```

0 commit comments

Comments
 (0)