Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. In [4]: base = "file:///tmp/tmp60uy_xo4tng_pi/devices/10.47.12.11/schema/current/AXLAPI.wsdl"
  2.  
  3. In [5]: location = "AXLSoap.xsd"
  4.  
  5. In [6]: absolute_location(location, base)
  6. Out[6]: '/home/oheddela/file:/tmp/tmp60uy_xo4tng_pi/devices/10.47.12.11/schema/current/AXLSoap.xsd'
  7.  
  8. In [7]: from six.moves.urllib.parse import urljoin
  9.  
  10. In [8]: urljoin(base, location)
  11. Out[8]: 'file:///tmp/tmp60uy_xo4tng_pi/devices/10.47.12.11/schema/current/AXLSoap.xsd'
  12.  
  13. In [9]: import os
  14.  
  15. In [10]: os.path.isabs(location)
  16. Out[10]: False
  17.  
  18. In [11]: os.path.realpath(location)
  19. Out[11]: '/home/oheddela/AXLSoap.xsd'
  20.  
  21. In [12]: os.path.dirname(base)
  22. Out[12]: 'file:///tmp/tmp60uy_xo4tng_pi/devices/10.47.12.11/schema/current'
  23.  
  24. In [13]: os.path.join(os.path.dirname(base), location)
  25. Out[13]: 'file:///tmp/tmp60uy_xo4tng_pi/devices/10.47.12.11/schema/current/AXLSoap.xsd'
  26.  
  27. In [14]: os.path.realpath(os.path.join(os.path.dirname(base), location))
  28. 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