mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-17 07:48:18 +01:00
fix function get_file
This commit is contained in:
parent
3d83d7d9ef
commit
2431783b96
1 changed files with 8 additions and 9 deletions
15
bin/slpkg
15
bin/slpkg
|
@ -49,7 +49,7 @@ import subprocess
|
||||||
|
|
||||||
|
|
||||||
__author__ = "dslackw"
|
__author__ = "dslackw"
|
||||||
__version__ = "1.5.3"
|
__version__ = "1.5.2"
|
||||||
__license__ = "GNU General Public License v3 (GPLv3)"
|
__license__ = "GNU General Public License v3 (GPLv3)"
|
||||||
__email__ = "d.zlatanidis@gmail.com"
|
__email__ = "d.zlatanidis@gmail.com"
|
||||||
|
|
||||||
|
@ -141,16 +141,15 @@ def rmv_unused(name):
|
||||||
|
|
||||||
# get filename from links
|
# get filename from links
|
||||||
def get_file(link, char):
|
def get_file(link, char):
|
||||||
j = 0
|
i = 0
|
||||||
results = []
|
results = []
|
||||||
for urls in link:
|
for file in range(len(link)):
|
||||||
j += 1
|
i -= 1
|
||||||
results.append(link[-j:])
|
results.append(link[i])
|
||||||
for file in results:
|
if link[i] == char:
|
||||||
if file.startswith(char):
|
|
||||||
break
|
break
|
||||||
|
|
||||||
return file.replace(char, "").strip(' ')
|
return ''.join(results[::-1]).replace('/', '').strip(' ')
|
||||||
|
|
||||||
|
|
||||||
# this fuction return if the package exist
|
# this fuction return if the package exist
|
||||||
|
|
Loading…
Reference in a new issue