def cfg_hasthis(): result = False if '/token' in request.path: if settings.get('oauth_token') is not None: result = True elif '/oauth' in request.path: result = oauth.hasOAuth() return jsonify({'result': result})
settings.setUser('tvservice', tvservice) settings.setUser('width', width) settings.setUser('height', height) settings.save() # Force display to desired user setting display.enable(True, True) # Load services services = ServiceManager(settings) # Spin until we have internet, check every 10s while True: settings.set('local-ip', helper.getIP()) if settings.get('local-ip') is None: logging.error( 'You must have functional internet connection to use this app') display.message('No internet\n\nCheck wifi-config.txt or cable') time.sleep(10) else: break # Let the display know the URL to use display.setConfigPage('http://%s:%d/' % (settings.get('local-ip'), 7777)) # Prep random random.seed(long(time.clock())) colormatch = colormatch(settings.get('colortemp-script'), 2700) # 2700K = Soft white, lowest we'll go slideshow = slideshow(display, settings, colormatch)
from statistics import median from typing import Dict, List import ccxt import tqdm from modules.exchange import Price from modules.settings import settings from .coinone import coinone from .gopax import gopax EXCHANGE = settings.get('EXCHANGE', { "BLACKLIST": [], "WHITELIST": [], }) EXCHANGE_BLACKLIST = EXCHANGE.get('BLACKLIST', []) EXCHANGE_WHITELIST = EXCHANGE.get('WHITELIST', None) DENOM = settings['UPDATER']['DENOM'] # Inserting lite implementation of gopax API to ccxt setattr(ccxt, "gopax", gopax) ccxt.exchanges.append("gopax") # replace coinone exchange with custom lite implementation to support LUNA/KRW pair setattr(ccxt, "coinone", coinone) # noinspection PyBroadException def filter_exchanges(currencies,
def oauthGetToken(): return settings.get('oauth_token')
'%s %s %s' % (current['group'], current['mode'], current['drive'])) settings.setUser('width', int(current['width'])) settings.setUser('height', int(current['height'])) settings.save() display = display(settings.getUser('width'), settings.getUser('height'), settings.getUser('depth'), settings.getUser('tvservice')) # Force display to desired user setting display.enable(True, True) # Spin until we have internet, check every 10s while True: settings.set('local-ip', helper.getIP()) if settings.get('local-ip') is None: logging.error( 'You must have functional internet connection to use this app') display.message('No internet') time.sleep(10) else: break def oauthGetToken(): return settings.get('oauth_token') def oauthSetToken(token): settings.set('oauth_token', token)
settings.setUser('tvservice', tvservice) settings.setUser('width', width) settings.setUser('height', height) settings.save() # Force display to desired user setting display.enable(True, True) # Load services services = ServiceManager(settings) # Spin until we have internet, check every 10s while True: settings.set('local-ip', helper.getIP()) if settings.get('local-ip') is None: logging.error('You must have functional internet connection to use this app') display.message('No internet') time.sleep(10) else: break # Let the display know the URL to use display.setConfigPage('http://%s:%d/' % (settings.get('local-ip'), 7777)) # Prep random random.seed(long(time.clock())) colormatch = colormatch(settings.get('colortemp-script'), 2700) # 2700K = Soft white, lowest we'll go slideshow = slideshow(display, settings, colormatch) timekeeper = timekeeper(display.enable, slideshow.start) slideshow.setQueryPower(timekeeper.getDisplayOn)
settings.save() width, height, tvservice = display.setConfiguration(settings.getUser('tvservice'), settings.getUser('display-special')) settings.setUser('tvservice', tvservice) settings.setUser('width', width) settings.setUser('height', height) settings.save() # Force display to desired user setting display.enable(True, True) # Spin until we have internet, check every 10s while True: settings.set('local-ip', helper.getIP()) if settings.get('local-ip') is None: logging.error('You must have functional internet connection to use this app') display.message('No internet') time.sleep(10) else: break # Once we have IP, show for 30s cd = 10 while (cd > 0): display.message('Starting in %d seconds\n\nFrame configuration\n\nhttp://%s:7777' % (cd, settings.get('local-ip'))) cd -= 1 time.sleep(1) def oauthGetToken(): return settings.get('oauth_token')
settings.save() width, height, tvservice = display.setConfiguration(settings.getUser('tvservice'), settings.getUser('display-special')) settings.setUser('tvservice', tvservice) settings.setUser('width', width) settings.setUser('height', height) settings.save() # Force display to desired user setting display.enable(True, True) # Spin until we have internet, check every 10s while True: settings.set('local-ip', helper.getIP()) if settings.get('local-ip') is None: logging.error('You must have functional internet connection to use this app') display.message('No internet') time.sleep(10) else: break def oauthGetToken(): return settings.get('oauth_token') def oauthSetToken(token): settings.set('oauth_token', token) settings.save() oauth = OAuth(settings.get('local-ip'), oauthSetToken, oauthGetToken)
settings.setUser('tvservice', tvservice) settings.setUser('width', width) settings.setUser('height', height) settings.save() # Force display to desired user setting display.enable(True, True) # Load services services = ServiceManager(settings) # Spin until we have internet, check every 10s while True: settings.set('local-ip', helper.getIP()) if settings.get('local-ip') is None: logging.error( 'You must have functional internet connection to use this app') display.message('No internet') time.sleep(10) else: break # Prep random random.seed(long(time.clock())) colormatch = colormatch(settings.get('colortemp-script'), 2700) # 2700K = Soft white, lowest we'll go slideshow = slideshow(display, settings, colormatch) timekeeper = timekeeper(display.enable, slideshow.start) slideshow.setQueryPower(timekeeper.getDisplayOn) slideshow.setServiceManager(services)