def setup(): global HOME, arch, db_conn HOME = getenv('HOME', '/home/pi') arch = machine() signal(SIGUSR1, sigusr1) load_settings() db_conn = db.conn(settings['database']) sh.mkdir(SCREENLY_HTML, p=True) html_templates.black_page(BLACK_PAGE)
def setup(): # ================= sentry_sdk.init("https://[email protected]/1533664") # ================= global HOME, arch, db_conn HOME = getenv('HOME', '/home/pi') arch = machine() signal(SIGUSR1, sigusr1) signal(SIGALRM, sigalrm) load_settings() db_conn = db.conn(settings['database']) sh.mkdir(SCREENLY_HTML, p=True) html_templates.black_page(BLACK_PAGE)
def __init__(self): global home home = getenv('HOME', '/home/pi') self.currentId = None self.currentDirectory = None self.worker = None signal(SIGUSR1, sigusr1) signal(SIGUSR2, sigusr2) settings.load() logging.getLogger().setLevel(logging.INFO) try: sh.mkdir(SCREENLY_HTML) except: pass html_templates.black_page(BLACK_PAGE) load_browser(url='http://{0}:{1}/splash_page'.format( settings.get_listen_ip(), settings.get_listen_port())) sleep(30)
def setup(): global HOME, arch, db_conn HOME = getenv('HOME', '/home/pi') arch = machine() signal(SIGUSR1, sigusr1) signal(SIGUSR2, sigusr2) load_settings() db_conn = settings['database'] if not RCA: screen = check_output(['tvservice', '-s']).split(" ")[8] else: screen = check_output(['tvservice', '-s']).split(" ")[4] Popen(["/home/pi/ridsc/misc/display_rotate.sh %s" % settings['display_rotate']],shell=True) screen = screen.split("x")[1]+"x"+screen.split("x")[0] if int(settings['display_rotate']) else screen generate_rsync_file(screen) screen = screen.split("x") set_spec(screen) sh.mkdir(RIDS_HTML, p=True) my_ip = get_node_ip() if my_ip: ip_lookup = True url = "Your local ip is {}".format(my_ip) else: ip_lookup = False url = "Unable to look up your installation's IP address." html_templates.black_page(BLACK_PAGE,settings,div_dic) html_templates.ticker_sidebar_page(TICKER_SIDEBAR_PAGE,settings,div_dic,spec) html_templates.splash_page(SPLASH_PAGE,url,INSTALLATION_ID,settings)
signal.signal(signal.SIGUSR1, sigusr1) signal.signal(signal.SIGUSR2, sigusr2) # Before we start, reload the settings. reload_settings() global db_conn db_conn = db.conn(settings.get_database()) # Create folder to hold HTML-pages html_folder = '/tmp/screenly_html/' if not path.isdir(html_folder): makedirs(html_folder) # Set up HTML templates black_page = html_templates.black_page() # Fire up the browser run_browser = load_browser() logging.debug('Getting browser PID.') browser_pid = run_browser.pid logging.debug('Getting FIFO.') fifo = get_fifo() logging.debug('Disable the browser status bar.') disable_browser_status() # Disable load screen early if initialization mode if not is_pro_init:
show_splash = str_to_bol(config.get('viewer', 'show_splash')) audio_output = config.get('viewer', 'audio_output') shuffle_playlist = str_to_bol(config.get('viewer', 'shuffle_playlist')) try: resolution = config.get('viewer', 'resolution') except: resolution = '1920x1080' # Create folder to hold HTML-pages html_folder = '/tmp/screenly_html/' if not path.isdir(html_folder): makedirs(html_folder) # Set up HTML templates black_page = html_templates.black_page() # Fire up the browser run_browser = load_browser() logging.debug('Getting browser PID.') browser_pid = run_browser.pid logging.debug('Getting FIFO.') fifo = get_fifo() # Bring up the blank page (in case there are only videos). logging.debug('Loading blank page.') view_web(black_page, 1) logging.debug('Disable the browser status bar')