예제 #1
0
파일: app.py 프로젝트: samjaninf/simpleapi
import sys
import os
import time

root = os.path.abspath(
    os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../'))
sys.path.append(root)

from simpleapi import Route, DummyClient, RemoteException
from handlers import MyAPI

client = DummyClient(Route(MyAPI, framework='dummy'))
for i in xrange(5):
    try:
        print len(client.download(url="http://www.pizzabus.de"))
    except RemoteException, e:
        print "Failure during request:", e
        time.sleep(.5)
예제 #2
0
import sys
import os

root = os.path.abspath(
    os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../'))
sys.path.append(root)

from simpleapi import Route, DummyClient, RemoteException
from handlers import MyAPI

client = DummyClient(Route(MyAPI, framework='dummy', debug=True))
try:
    client.add_one(a=1, b=5)
except RemoteException, e:
    print "Exception raised:", e
client.download(url="http://www.pizzabus.de")
예제 #3
0
import sys
import os
import time

root = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                    '../../../'))
sys.path.append(root)

from simpleapi import Route, DummyClient, RemoteException
from handlers import MyAPI

client = DummyClient(Route(MyAPI, framework='dummy'))
for i in xrange(5):
    try:
        print len(client.download(url="http://www.pizzabus.de"))
    except RemoteException, e:
        print "Failure during request:", e
        time.sleep(.5)