from eyes import Eyes
import pprint

e = Eyes()
e.auth()

e.searchProcesso("5002074-02.2015.404.7005")
# e.acessarIntegra()
# e.exibirTodosEventos()
# print(e.getAdicionais())
# teste = e.getCapa()
# print(teste)
# e.getAssuntos()
# print(e.getPartes())
# eventos = e.getEventos()
# pprint.pprint(eventos)
# for ev in eventos:
# 	# pprint.pprint(ev['documentos'])
# 	if ev['documentos']:
# 		for doc in ev['documentos']:
# 			if doc['tipo'] == 'html':
# 				e.download_html(doc['url'], doc['nome'])
# 			elif doc['tipo'] == 'pdf':
# 				e.download_pdf(doc['url'], doc['nome'])
# 				input("Press Enter to continue...")
# 			# doc[]
e.close()
Example #2
0
    """Map in value range to another range"""
    y = (x - lowerIn) / (upperIn - lowerIn) * (upperOut - lowerOut) + lowerOut
    return y


def millis():
    """ Returns current time in milliseconds."""
    return int(round(time.time() * 1000))


# Main loop
if __name__ == "__main__":
    lastCall = millis()
    while (True):
        faceCoords = camera.detectFace(False)
        x = faceCoords[0]
        y = faceCoords[1]
        if x > 0:
            if millis() > lastCall:
                outX = translate(x, 0, 640, 50, 120)
                outY = translate(y, 0, 480, 70, 110)
                lastCall = millis() + 1

        body.turnXAxis(outX)
        body.turnYAxis(outY)

        key = waitKey(1)
        if key == 27:  # exit on ESC
            camera.close()
            break
                data_hora=_evento['data_hora'],
                descricao=_evento['descricao'],
                tem_arquivo=True if _evento['documentos'] else False,
                processo_id=processo.id,
                usuario_eproc_id=usuario_eproc.id)
    except Exception as e:
        print('Falha ao salvar eventos: {} \n e: {}'.format(
            processo.numero, str(e)))
        pass

    try:
        miner.move_files()
    except Exception as e:
        print(
            'Há downloads incompletos, certifique-se da conexão com a internet. Tentando novamente mover arquivos.'
        )
        miner.move_files()
        pass

    eyes.reset()

    # if reauth_in == aux_reauth:
    # 	eyes.logout()
    # 	eyes.auth()
    # 	aux_reauth = 1
    # else:
    # 	aux_reauth += 1

    # time.sleep(60)
eyes.close()