Created
August 12, 2019 19:25
-
-
Save juelvaldivia/b20c68ed3d96afb56cf913f5af32e8dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'juel' | |
# -*- coding: 850 -*- | |
from eralchemy import render_er | |
import getpass | |
import psycopg2 | |
salida = False | |
while not salida : | |
print 'Entre las credenciales del servidor--->' | |
servidor = raw_input("Entre servidor : ") | |
puerto = raw_input("Entre el puerto : ") | |
basedatos = raw_input("Entre el la base de datos: ") | |
usuario = raw_input("Entre el usuario: ") | |
contrasena = getpass.getpass('Password') | |
try: | |
cadena = 'postgresql+psycopg2://'+usuario+':'+contrasena+'@'+servidor+':'+puerto+'/'+basedatos | |
render_er(cadena, basedatos+'-er.pdf') | |
render_er(cadena, basedatos+'-er.png') | |
print 'El modelo se encuentra en el archivo '+basedatos+'-er.pdf y '+basedatos+'-er.png' | |
salida=True | |
except Exception, e: | |
print u'Verifique los parametros de conexion' | |
print str(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment