@@ -119,19 +119,7 @@ def upgrade_from_dev_dialog(version_installed, notebook, show_no_update=False):
119119 f"{ SPC } \n " , wx .GetActiveWindow (), no_default = True ):
120120 return False
121121 else :
122- import zipfile
123- backup_configobj = tempfile .NamedTemporaryFile (delete = False )
124- config_obj_dir = path .join (path .dirname (__file__ ), '../preferences/configobj' )
125- files = os .listdir (config_obj_dir )
126- with zipfile .ZipFile (backup_configobj .name , 'w' ) as zzip :
127- for file in files :
128- file_path = os .path .join (config_obj_dir , file )
129- zzip .write (file_path )
130122 do_upgrade (command , notebook )
131- with zipfile .ZipFile (backup_configobj .name , 'r' ) as zzip :
132- zzip .extractall (config_obj_dir )
133- print (f"DEBUG: updatentivier, { config_obj_dir = } { backup_configobj .name } " )
134- os .remove (backup_configobj .name )
135123 return True
136124 else :
137125 if show_no_update :
@@ -188,6 +176,26 @@ def do_upgrade(command, notebook):
188176
189177def start_upgraded (message ):
190178 __ = message
179+ import zipfile
180+ import requests
181+
182+ def download_url (url , save_path , chunk_size = 128 ):
183+ r = requests .get (url , stream = True )
184+ with open (save_path , 'wb' ) as fd :
185+ for chunk in r .iter_content (chunk_size = chunk_size ):
186+ fd .write (chunk )
187+
188+ backup_configobj = tempfile .NamedTemporaryFile (delete = False )
189+ config_obj_dir = path .join (path .dirname (__file__ ), '../preferences' )
190+ # print(f"DEBUG: updatenotifier, Starting do_upgrade {config_obj_dir=} zip is {backup_configobj.name=}")
191+ download_url ('https://robotframework.transformidea.com/RIDE/packages/configobj.zip' , backup_configobj .name )
192+ with zipfile .ZipFile (backup_configobj , 'r' ) as zzip :
193+ zzip .extractall (config_obj_dir )
194+ # print(f"DEBUG: updatenotifier, {config_obj_dir=} extracted {backup_configobj.name}")
195+ try :
196+ os .remove (backup_configobj .name )
197+ except PermissionError :
198+ pass
191199 command = sys .executable + " -m robotide.__init__ --noupdatecheck"
192200 wx .CallLater (1000 , subprocess .Popen , command .split (' ' ), start_new_session = True )
193201 p = psutil .Process ()
0 commit comments