Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [4]: base = "file:///tmp/tmp60uy_xo4tng_pi/devices/10.47.12.11/schema/current/AXLAPI.wsdl"
- In [5]: location = "AXLSoap.xsd"
- In [6]: absolute_location(location, base)
- Out[6]: '/home/oheddela/file:/tmp/tmp60uy_xo4tng_pi/devices/10.47.12.11/schema/current/AXLSoap.xsd'
- In [7]: from six.moves.urllib.parse import urljoin
- In [8]: urljoin(base, location)
- Out[8]: 'file:///tmp/tmp60uy_xo4tng_pi/devices/10.47.12.11/schema/current/AXLSoap.xsd'
- In [9]: import os
- In [10]: os.path.isabs(location)
- Out[10]: False
- In [11]: os.path.realpath(location)
- Out[11]: '/home/oheddela/AXLSoap.xsd'
- In [12]: os.path.dirname(base)
- Out[12]: 'file:///tmp/tmp60uy_xo4tng_pi/devices/10.47.12.11/schema/current'
- In [13]: os.path.join(os.path.dirname(base), location)
- Out[13]: 'file:///tmp/tmp60uy_xo4tng_pi/devices/10.47.12.11/schema/current/AXLSoap.xsd'
- In [14]: os.path.realpath(os.path.join(os.path.dirname(base), location))
- Out[14]: '/home/oheddela/file:/tmp/tmp60uy_xo4tng_pi/devices/10.47.12.11/schema/current/AXLSoap.xsd'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement