Exemple #1
0
from functions import query
import time

n = query("SELECT * FROM elefants;").rowcount

while True:
    time.sleep(1)
    try:
        num = query("SELECT * FROM elefants;").rowcount
        print "%s elefantes se balanceaban, como veian que no se caian," \
              " fueron a llamar a otro elefante, llamado: %d" % (num, n)
        query("INSERT INTO elefants (name) VALUES ('%d');" % n)
    except:
        print "ERROR: El elefante %d se ha caido de la tela" % n
    n = n + 1
Exemple #2
0
from functions import query

query("CREATE TABLE elefants (id serial PRIMARY KEY, name varchar);")

Exemple #3
0
from functions import query
import time

cluster = "192.168.0.100"
nodo1 = "192.168.0.1"
nodo2 = "192.168.0.2"

n = query("SELECT * FROM elefants;", cluster).rowcount

while True:
    time.sleep(1)
    try:
        num1 = query("SELECT * FROM elefants;", nodo1).rowcount
    except:
        num1 = 0
    try:
        num2 = query("SELECT * FROM elefants;", nodo2).rowcount
    except:
        num2 = 0
    print "NODO1 %d -- %d NODO2" % (num1, num2)
Exemple #4
0
from functions import query
import time

cluster = "192.168.0.100"
nodo1 = "192.168.0.1"
nodo2 = "192.168.0.2"

n = query("SELECT * FROM elefants;", cluster).rowcount

while True:
    time.sleep(1)
    try:
        num1  = query("SELECT * FROM elefants;", nodo1).rowcount
    except:
        num1 = 0
    try:
        num2  = query("SELECT * FROM elefants;", nodo2).rowcount
    except:
        num2 = 0
    print "NODO1 %d -- %d NODO2" % (num1, num2)
Exemple #5
0
from functions import query
import time

n = query("SELECT * FROM elefants;").rowcount

while True:
    time.sleep(1)
    try:
        num  = query("SELECT * FROM elefants;").rowcount
        print "%s elefantes se balanceaban, como veian que no se caian," \
              " fueron a llamar a otro elefante, llamado: %d" % (num, n)
        query("INSERT INTO elefants (name) VALUES ('%d');" % n)
    except:
        print "ERROR: El elefante %d se ha caido de la tela" % n
    n = n + 1


Exemple #6
0
def node(request, name):  
    t = functions.query(name)
    data = functions.paginator(request, t)
    data["breadcrumb"] = functions.breadcrumb(name)
    return render(request,'node_view.html', data)
Exemple #7
0
def node_year_month_day(request, name, year, month, day):
    t = functions.query(name, year, month, day)
    data = functions.paginator(request, t)
    data["breadcrumb"] = functions.breadcrumb(name,year,month,day)
    return render(request,'node_view.html', data)
Exemple #8
0
from functions import query
import time

n = query("SELECT * FROM elefants;").rowcount
print "Hay %s elefantes en la tela" % n
Exemple #9
0
# import functions
import functions

# initialise program
functions.query()