示例#1
0
def record_window(window_name, fps, output_file_path, manual_geometry=None):
    # Step 1: getting geometry of the target window
    if manual_geometry is None:
        print('Detecting geometry...')
        window_id, left, top, width, height = get_window_geometry(window_name)
    else:
        print('Using manual geometry...')
        left, top, width, height = manual_geometry
        window_id = get_window_id(window_name)

    # Step 2: creating condition callback function
    # that checks whether target window is still open
    condition_callback = lambda: window_is_open(window_id)

    # Step 3: creating action callback function
    # that will bring target window to the front
    # each time we need to make screenshot
    # action_callback = lambda: bring2front(window_id)
    # or just bringing it once
    bring2front(window_id)

    # Step 4: running window recording
    record_frame(
        left, top, width, height,
        fps, output_file_path,
        condition_callback,
        # action_callback
    )
示例#2
0
def get_ecranEspera():
    window_id = str(get_window_id())
    from gap_multimedia import GAPMultimedia
    playlist = GAPMultimedia().get_playlist()
    playlistsize = len(playlist) #para ajudar no controlo do playlist
    playlist = ''.join(playlist)
    return dict(title='Ecran Espera', window_id=window_id,playlist=playlist,playlistsize=playlistsize)
示例#3
0
def help():
    """Devolve a pagina de Ajuda"""
    window_id = str(get_window_id())
    set_base_context(window_id)
    ctx_dict = get_context(window_id)
    ctx_dict['window_id'] = window_id
    ctx_dict['name'] = 'help'
    ctx_dict['title'] = 'Ajuda'


    code = """
        <textarea rows="30" class="small-12 large-12 columns">
    """
    code += """
    Ajuda

    Por Implementar...

    """
    code += """
        </textarea>
    """
    ctx_dict['form'] = code
    set_context(window_id, ctx_dict)
    return ctx_dict
示例#4
0
def about():
    """Devolve a pagina about"""
    window_id = str(get_window_id())
    set_base_context(window_id)
    ctx_dict = get_context(window_id)
    ctx_dict['window_id'] = window_id
    ctx_dict['name'] = 'about'
    ctx_dict['title'] = 'Sobre'
    code = """
        <div class="small-12 large-12 columns">
        <textarea rows="30" readonly>
    """
    code += """
    Sobre o ERP+

    Versão 1.0 de 2015

    O ERP + é uma plataforma de Gestão sobre a qual qualquer pessoa pode desenvolver
    objectos que suportem o seu negócio ou actividade.

    Bom trabalho

    Contactos:

    Dario Costa
    +238 983 04 90

    """
    code += """
        </textarea>
        </div>
    """
    ctx_dict['form'] = code
    set_context(window_id, ctx_dict)
    return ctx_dict
示例#5
0
def get_new_window_id(window):
    """A funçao que atribui novos window_id a chamar de base.tpl"""
    #print(window)
    window = window.split('_')
    window_name = window[0]
    window_id = window[1]
    #print('im in the get_new_window_id called by base.tpl',
     #     window_name,
      #    window_id)
    return get_window_id(window_name=window_name, window_id=window_id)
示例#6
0
def main():
    """Funçao index"""
    print('Init do main_route')
    window_id = str(get_window_id())
    print(window_id)
    set_base_context(window_id)
    print('oi')
    ctx_dict = get_context(window_id)
    print(ctx_dict)
    ctx_dict['window_id'] = window_id
    ctx_dict['name'] = 'index'
    ctx_dict['title'] = 'ERP +'
    ctx_dict['form'] = ''
    print(ctx_dict)
    set_context(window_id, ctx_dict)
    return ctx_dict
    def __init__(self, window_name, log_dir_path, log_name):
        super().__init__()

        self.term_flag = False

        platform_name = platform.system()
        if platform_name == 'Windows':
            self.make_screenshot = lambda file_path: win32_utils.make_screenshot(window_name, file_path)
        elif platform_name == 'Linux':
            window_id = get_window_id(window_name)
            self.make_screenshot = lambda file_path: exec_shell_cmd(f'import -window {window_id} {file_path}')
        else:
            raise Exception('Not valid platform: %s' % platform_name)

        self.log_dir_path = log_dir_path
        self.log_name = log_name

        print('Created recorder for window with name %s' % window_name)
        print('Recorder log path: %s' % path.join(self.log_dir_path, self.log_name))
示例#8
0
def licence():
    """Devolve a pagina da Licença"""
    window_id = str(get_window_id())
    set_base_context(window_id)
    ctx_dict = get_context(window_id)
    ctx_dict['window_id'] = window_id
    ctx_dict['name'] = 'licence'
    ctx_dict['title'] = 'Licença'

    licence_file = open('/var/www/core/help/licence.txt', 'r', encoding='utf8')
    code = """
        <textarea rows="30" class="small-12 large-12 columns">
    """
    code += licence_file.read()
    code += """
        </textarea>
    """
    ctx_dict['form'] = code
    set_context(window_id, ctx_dict)
    return ctx_dict
示例#9
0
def update():
    """Devolve a pagina de Actualizaçao da Implementacao Local"""
    window_id = str(get_window_id())
    set_base_context(window_id)
    ctx_dict = get_context(window_id)
    ctx_dict['window_id'] = window_id
    ctx_dict['name'] = 'update'
    ctx_dict['title'] = 'Actualização'

    code = """
        <textarea rows="30" class="small-12 large-12 columns">
    """
    code += """
    Actualização

    Por Implementar...

    """
    code += """
        </textarea>
    """
    ctx_dict['form'] = code
    set_context(window_id, ctx_dict)
    return ctx_dict
示例#10
0
def login_form():
    """Implementa o Ecra de Login"""
    window_id = str(get_window_id())
    import erp_config as ec
    return dict(name='login', title='Autenticação do ERP+', url='url', favicon=ec.favicon, system_logo=ec.system_logo, logotipo=ec.logotipo, enterprise=ec.enterprise, form='', window_id=window_id)