Skip to content

Commit

Permalink
Added driver and fixed error case with oauth.json being corrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
Tester-Testsson committed Jun 20, 2018
1 parent 60e4e4f commit ac80e8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions display-drivers/waveshare35b/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"driver": "waveshare35b", "options": {"dtoverlay": "waveshare35b"}, "install": [{"src": "waveshare35b-overlay.dtb", "dst": "/boot/overlays/waveshare35b.dtbo"}, {"src": "waveshare35b-overlay.dtb", "dst": "/boot/overlays/waveshare35b-overlay.dtb"}]}
Binary file not shown.
13 changes: 8 additions & 5 deletions frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,14 @@ def oauthSetToken(token):
oauth = OAuth(settings.get('local-ip'), oauthSetToken, oauthGetToken)

if os.path.exists('/root/photoframe_config/oauth.json'):
with open('/root/photoframe_config/oauth.json') as f:
data = json.load(f)
if 'web' in data: # if someone added it via command-line
data = data['web']
oauth.setOAuth(data)
try:
with open('/root/photoframe_config/oauth.json') as f:
data = json.load(f)
if 'web' in data: # if someone added it via command-line
data = data['web']
oauth.setOAuth(data)
except:
logging.exception('OAuth file is corrupt, do not use')

# Prep random
random.seed(long(time.clock()))
Expand Down

0 comments on commit ac80e8a

Please sign in to comment.