44import os , subprocess , zipfile , shutil
55
66import zipfile , sys , urllib
7- path = 'https://github.com/Image-Py/imagepy/archive/master .zip'
7+ path = 'https://github.com/Image-Py/imagepy/archive/main .zip'
88
99from urllib .request import urlretrieve
1010import urllib
@@ -37,9 +37,9 @@ def run(self, para=None):
3737 url = para ['repo' ]
3838 if 'github.com' in url :
3939 if url [- 4 :] == '.git' :
40- url = url .replace ('.git' , '/archive/master .zip' )
40+ url = url .replace ('.git' , '/archive/main .zip' )
4141 elif url [- 4 :] != '.zip' :
42- url = url + '/archive/master .zip'
42+ url = url + '/archive/main .zip'
4343 domain , name = url .split ('/' )[- 4 :- 2 ]
4444 else :
4545 domain , name = (url [:- 4 ].replace ('.' ,'-' )).split ('/' )[- 2 :]
@@ -62,7 +62,7 @@ def run(self, para=None):
6262 zipf = zipfile .ZipFile (os .path .join (path_cache , domain + '_' + name + '.zip' ))
6363 folder = zipf .namelist ()[0 ]
6464 zipf .extractall (path_cache )
65- destpath = os .path .join (path_plgs , domain + '_' + folder .replace ('-master ' ,'' ))
65+ destpath = os .path .join (path_plgs , domain + '_' + folder .replace ('-main ' ,'' ))
6666 if os .path .exists (destpath ): shutil .rmtree (destpath )
6767 os .rename (os .path .join (path_cache , folder ), destpath )
6868 zipf .close ()
0 commit comments