File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
myDevices/devices/digital Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,10 @@ def __checkFilesystemExport__(self, channel):
179
179
f .write ("%s" % channel )
180
180
except PermissionError :
181
181
command = 'sudo python3 -m myDevices.devices.writevalue -f /sys/class/gpio/export -t {}' .format (channel )
182
- executeCommand (command )
182
+ executeCommand (command )
183
+ except OSError as ex :
184
+ debug (ex )
185
+ return False
183
186
except Exception as ex :
184
187
error ('Failed on __checkFilesystemExport__: ' + str (channel ) + ' ' + str (ex ))
185
188
return False
@@ -204,7 +207,6 @@ def __checkFilesystemFunction__(self, channel):
204
207
# since there is a delay when the gpio channel is first exported
205
208
sleep (0.01 )
206
209
207
-
208
210
def __checkFilesystemValue__ (self , channel ):
209
211
if not self .valueFile [channel ]:
210
212
#debug("value file %d not open" %channel)
@@ -286,9 +288,11 @@ def __getFunction__(self, channel):
286
288
return self .OUT
287
289
else :
288
290
return self .IN
291
+ except AttributeError :
292
+ debug ('AttributeError in __getFunction__: ' + str (channel ) + ' ' + str (ex ))
289
293
except Exception as ex :
290
294
error ('Failed on __getFunction__: ' + str (channel ) + ' ' + str (ex ))
291
- return - 1
295
+ return - 1
292
296
293
297
def __setFunction__ (self , channel , value ):
294
298
self .__checkFilesystemFunction__ (channel )
You can’t perform that action at this time.
0 commit comments