Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
id2
S
Software
S
services
FAIR
Software Quality Assurance
Commits
0549ebb1
Commit
0549ebb1
authored
May 26, 2020
by
Maximilian Dolling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handled import ub subclasses
parent
6ee9adae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
src/services/list-used-licenses/functions/language_parser.py
src/services/list-used-licenses/functions/language_parser.py
+14
-2
No files found.
src/services/list-used-licenses/functions/language_parser.py
View file @
0549ebb1
...
...
@@ -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_
lib
s
_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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment