Skip to content

Commit ebc1344

Browse files
committed
move wsdl inside package instead of /etc/onvif/wsdl
1 parent 1d7d642 commit ebc1344

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

onvif/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from suds.sax.text import Text
1212
from onvif import ONVIFCamera, ONVIFService, ONVIFError
1313
from definition import SERVICES
14+
import os.path
1415

1516
SUPPORTED_SERVICES = SERVICES.keys()
1617

@@ -129,7 +130,7 @@ def create_parser():
129130
help='Username for authentication')
130131
parser.add_argument('-a', '--password', required=True,
131132
help='Password for authentication')
132-
parser.add_argument('-w', '--wsdl', default='/etc/onvif/wsdl/',
133+
parser.add_argument('-w', '--wsdl', default=os.path.join(os.path.dirname(os.path.dirname(__file__)), "wsdl"),
133134
help='directory to store ONVIF WSDL documents')
134135
parser.add_argument('-e', '--encrypt', default='False',
135136
help='Encrypt password or not')

onvif/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class ONVIFCamera(object):
204204
# Class-level variables
205205
services_template = {'devicemgmt': None, 'ptz': None, 'media': None,
206206
'imaging': None, 'events': None, 'analytics': None }
207-
def __init__(self, host, port ,user, passwd, wsdl_dir='/etc/onvif/wsdl/',
207+
def __init__(self, host, port ,user, passwd, wsdl_dir=os.path.join(os.path.dirname(os.path.dirname(__file__)), "wsdl"),
208208
cache_location=None, cache_duration=None,
209209
encrypt=True, daemon=False, no_cache=False):
210210
self.host = host

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
packages=find_packages(exclude=['docs', 'examples', 'tests']),
4545
install_requires=requires,
4646
include_package_data=True,
47-
data_files=[('/etc/onvif/wsdl', wsdl_files)],
47+
data_files=[('wsdl', wsdl_files)],
4848
entry_points={
4949
'console_scripts': ['onvif-cli = onvif.cli:main']
5050
}

0 commit comments

Comments
 (0)