File tree Expand file tree Collapse file tree 1 file changed +20
-13
lines changed Expand file tree Collapse file tree 1 file changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ def get_packages(url):
24
24
exit (1 )
25
25
26
26
if "A required part of this site couldn’t load" in response .text :
27
- print ("Fastly is blocking us. Status code: 403" )
27
+ print (f "Fastly is blocking us for { url } . Status code: 403" )
28
28
exit (1 )
29
29
30
30
# Parse the HTML content
@@ -97,16 +97,23 @@ def maybefloat(x):
97
97
98
98
if __name__ == "__main__" :
99
99
# URL of the webpage
100
- if sys .argv [1 ] == "--org" :
101
- url = f"https://pypi.org/org/{ sys .argv [2 ]} /"
102
- packages = get_packages (url )
103
- elif sys .argv [1 ] == "--user" :
104
- url = f"https://pypi.org/user/{ sys .argv [2 ]} /"
105
- packages = get_packages (url )
106
- elif sys .argv [1 ] == "--packages" :
107
- packages = sys .argv [2 :]
108
- else :
109
- print ("Invalid argument. Please use either --org ORG or --user USER" )
110
- exit (1 )
111
-
100
+ args = sys .argv [1 :]
101
+ packages = []
102
+ while args :
103
+ if args [0 ] == "--org" :
104
+ url = f"https://pypi.org/org/{ args [1 ]} /"
105
+ packages += get_packages (url )
106
+ args = args [2 :]
107
+ elif args [0 ] == "--user" :
108
+ url = f"https://pypi.org/user/{ args [1 ]} /"
109
+ packages += get_packages (url )
110
+ args = args [2 :]
111
+ elif args [0 ] == "--packages" :
112
+ packages += args [1 :]
113
+ args = []
114
+ else :
115
+ print (
116
+ "Invalid argument. Please use either --org ORG, --user USER or --packages PACKAGE1 PACKAGE2 ..."
117
+ )
118
+ exit (1 )
112
119
get_tidelift_data (packages )
You can’t perform that action at this time.
0 commit comments