@@ -49,29 +49,6 @@ def normalize(name):
49
49
return re .sub (r"[-_.]+" , "-" , name ).lower ()
50
50
51
51
52
- def get_official_description (name ):
53
- """Extract package Summary description from pypi.org"""
54
- from winpython import utils
55
-
56
- this = normalize (name )
57
- this_len = len (this )
58
- pip_ask = ["pip" , "search" , this , "--retries" , "0" ]
59
- if len (this ) < 2 : # don't ask stupid things
60
- return ""
61
- try :
62
- # .run work when .popen fails when no internet
63
- pip_res = (utils .exec_run_cmd (pip_ask ) + "\n " ).splitlines ()
64
- pip_filter = [
65
- l
66
- for l in pip_res
67
- if this + " (" == normalize (l [:this_len ]) + l [this_len : this_len + 2 ]
68
- ]
69
- pip_desc = (pip_filter [0 ][len (this ) + 1 :]).split (" - " , 1 )[1 ]
70
- return pip_desc .replace ("://" , " " )
71
- except :
72
- return ""
73
-
74
-
75
52
def get_package_metadata (database , name , gotoWWW = False , update = False ):
76
53
"""Extract infos (description, url) from the local database"""
77
54
# Note: we could use the PyPI database but this has been written on
@@ -104,11 +81,7 @@ def get_package_metadata(database, name, gotoWWW=False, update=False):
104
81
).splitlines ()[0 ]
105
82
except :
106
83
pass
107
- if my_metadata ["description" ] == "" and gotoWWW :
108
- # still nothing, try look on pypi
109
- the_official = get_official_description (name )
110
- if the_official != "" :
111
- my_metadata ["description" ] = the_official
84
+
112
85
if update == True and db_desc == "" and my_metadata ["description" ] != "" :
113
86
# we add new findings in our packgages.ini list, if it's required
114
87
try :
0 commit comments