Skip to content

Commit f86a6ff

Browse files
committed
A better implementation for #132. No more hard-coded 'urn' address
1 parent 28baa7c commit f86a6ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

about_code_tool/genabout.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import urllib2
3636

3737
from collections import namedtuple
38+
from urlparse import urljoin, urlparse
3839
from os import makedirs
3940
from os.path import exists, dirname, join, abspath, isdir, normpath, basename, expanduser
4041

@@ -436,7 +437,9 @@ def get_dje_license_list(self, gen_location, input_list, gen_license, dje_licens
436437
return license_output_list
437438

438439
def pre_process_and_dje_license_dict(self, input_list, api_url, api_username, api_key):
439-
dje_lic_urn = "https://enterprise.dejacode.com/urn/?urn=urn:dje:license:"
440+
dje_uri = urlparse(api_url)
441+
domain = '{uri.scheme}://{uri.netloc}/'.format(uri=dje_uri)
442+
dje_lic_urn = urljoin(domain, "urn/?urn=urn:dje:license:")
440443
key_text_dict = {}
441444
license_dict = {}
442445
for line in input_list:

0 commit comments

Comments
 (0)