10
10
from myDevices .utils .config import Config
11
11
from myDevices .utils .subprocess import executeCommand
12
12
13
- SETUP_NAME = 'myDevicesSetup_raspberrypi .sh'
13
+ SETUP_NAME = 'update_raspberrypi .sh'
14
14
INSTALL_PATH = '/etc/myDevices/'
15
15
UPDATE_PATH = INSTALL_PATH + 'updates/'
16
16
UPDATE_CFG = UPDATE_PATH + 'updatecfg'
@@ -52,7 +52,7 @@ def __init__(self, config, onUpdateConfig = None):
52
52
self .Continue = True
53
53
self .currentVersion = ''
54
54
self .newVersion = ''
55
- self .downloadUrl = ''
55
+ # self.downloadUrl = ''
56
56
self .UpdateCleanup ()
57
57
self .startTime = datetime .now () - timedelta (days = 1 )
58
58
@@ -146,9 +146,12 @@ def RetrieveUpdate(self):
146
146
updateConfig = Config (UPDATE_CFG )
147
147
try :
148
148
self .newVersion = updateConfig .get ('UPDATES' ,'Version' )
149
- self .downloadUrl = updateConfig .get ('UPDATES' ,'Url' )
150
149
except :
151
- error ('Updater missing: update version or Url' )
150
+ error ('Updater missing version' )
151
+ # try:
152
+ # self.downloadUrl = updateConfig.get('UPDATES','Url')
153
+ # except:
154
+ # error('Updater missing url')
152
155
info ('Updater retrieve update success' )
153
156
return True
154
157
except :
@@ -157,7 +160,7 @@ def RetrieveUpdate(self):
157
160
158
161
def DownloadFile (self , url , localPath ):
159
162
try :
160
- info ( url + ' ' + localPath )
163
+ info (url + ' ' + localPath )
161
164
with urlopen (url ) as response :
162
165
with open (localPath , 'wb' ) as output :
163
166
output .write (response .read ())
0 commit comments