Exemple #1
0
def main():
    """
    Start of talkshow execution
    """

    logger.debug("initialising talkshow.")


    # initialise screen heights and widths
    try:
        screenWidth = talkshowConfig.windowWidth
        screenHeight = talkshowConfig.windowHeight
        if screenHeight == 0 or screenWidth == 0:
            screenWidth = int(style.page.width)
            screenHeight = int(style.page.height)
    except:
        screenWidth = int(style.page.width)
        screenHeight = int(style.page.height)

    # screen object to be passed into Talkshow instance
    screen = Screen("KommHelp Talkshow", "", screenWidth, screenHeight)


    # initialise config and vlcPlayer
    config = configClass()
    player = vlcPlayer()

    # talkshow object and handler
    talkshow = Talkshow(config, screen, player)
    screen.event_handler = talkshow

    # periodicCall used for Scan mode
    pc = PeriodicCall(talkshow.tick,0)
    pyglet.app.run()
Exemple #2
0
def getRelativePath(path):
    '''
    Get the right path irrespective whether the file is within the compiled .exe or in source
    '''
    logger.debug("sys.executable under {0} ABSOLUTE={1}".format(os.path.dirname(sys.executable), os.path.abspath(os.path.dirname(sys.executable))))
    logger.debug("__file__ under {0} ABSOLUTE={1}".format(os.path.dirname(__file__), os.path.abspath(os.path.dirname(__file__))))

    application_path = os.path.dirname(__file__)

    if getattr(sys, 'frozen', False):
        logger.debug("starting from frozen .exe file")
    elif __file__:
        logger.debug("starting from python source")
    else:
        logger.warn("talkshow.getRelativePath function has a problem...")

    returnpath = os.path.join(application_path, path)

    logger.debug("returnpath = {0} ABS={1}".format(returnpath, os.path.abspath(returnpath)))

    return returnpath