Commit 0549ebb1 authored by Maximilian Dolling's avatar Maximilian Dolling

handled import ub subclasses

parent 6ee9adae
......@@ -79,10 +79,22 @@ def get_python_libs(file_path=''):
line = file.readline()
used_libs_list = []
for line in lines_with_libs_list:
lib_list = []
if line[0:7] == 'import ':
used_libs_list = used_libs_list + line[7:].replace(' ', '').split(",")
lib_list = line[7:].replace(' ', '').split(",")
if line[0:5] == 'from ':
used_libs_list.append(line.split(' ')[1])
lib_list = [line.split(' ')[1]]
tmp_lib_list =[]
for lib in lib_list:
if lib is not None:
if lib[0] == '.':
tmp_lib = lib[1:]
tmp_lib_list.append('.' + tmp_lib.split('.')[0])
else:
tmp_lib = lib
tmp_lib_list.append(tmp_lib.split('.')[0])
used_libs_list += tmp_lib_list
used_libs_list = list(dict.fromkeys(used_libs_list))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment