tchellomello / python-amcrest

A Python 2.7/3.x module for Amcrest and Dahua Cameras using the SDK HTTP API.
GNU General Public License v2.0
216 stars 76 forks source link

Implemented regex to remove 'http{s}://' and '/' characters from host #27

Closed tchellomello closed 7 years ago

tchellomello commented 7 years ago

Implemented regex to avoid user errors when defining a host. For example:

In [1]: from amcrest import AmcrestCamera
In [2]: data = AmcrestCamera('http://192.168.1.20/', 80, 'admin', 'secret')
In [3]: camera = data.camera
In [4]: camera._host
Out[4]: '192.168.1.20'
In [5]: camera.current_time
Out[5]: u'result=2017-01-06 19:24:17'

This PR addresses the issue #25

mention-bot commented 7 years ago

@tchellomello, thanks for your PR! By analyzing the history of the files in this pull request, we identified @dougsland to be a potential reviewer.

austinech commented 7 years ago

Awesome. Thanks again.

tchellomello commented 7 years ago

@dougsland any thoughts?

tchellomello commented 7 years ago

Tests ok, merging it.