A python library for interacting with Teknik Services
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

util.py 451B

12345678910111213141516171819202122
  1. try:
  2. from urllib.parse import urljoin
  3. except ImportError as e:
  4. from urlparse import urljoin
  5. defaultUrl = 'https://api.teknik.io/v1/'
  6. defaultUsername = ''
  7. defaultToken = ''
  8. def GetUrl(url, service):
  9. finalUrl = ''
  10. if url is None or url == '':
  11. url = defaultUrl
  12. server = service.lower()
  13. if service == 'upload':
  14. finalUrl = urljoin(url, 'Upload')
  15. elif service == 'paste':
  16. finalUrl = urljoin(url, 'Paste')
  17. return finalUrl