Пример #1
0
 def updateWorld(self, interval):
     """Update the objects in the world"""
     for zone in self.zones:
         if zone.active:
             zone.updateZone(interval, self)
     #
     # Process any scheduled actor deletions
     while self._scheduled_deletions:
         try:
             self.removeActor(self._scheduled_deletions.pop())
         except UnknownActor:
             # Ok, the actor must have been removed directly
             pass
Пример #2
0
 def updateWorld(self, interval):
     """Update the objects in the world"""
     for zone in self.zones:
         if zone.active:
             zone.updateZone(interval, self)
     #
     # Process any scheduled actor deletions
     while self._scheduled_deletions:
         try:
             self.removeActor(self._scheduled_deletions.pop())
         except UnknownActor:
             # Ok, the actor must have been removed directly
             pass
Пример #3
0
 def updateWorld(self, interval):
     """Update the objects in the world"""
     for zone in self.zones:
         if zone.active:
             zone.updateZone(interval, self)
Пример #4
0
def vote():
    idstr = request.params.get("id")
    id = int(idstr)
    video.videos[id - 1].vote_up = video.videos[id - 1].vote_up + 1
    zone.updateZone(video.videos)
    return ""
Пример #5
0
from bottle import route, run, get, request, post
import zone
import os
import json
import video

zone.updateZone(video.videos)


@get("/video")
def videoGet():

    # x1 = int(request.params.get('x1'))
    # y1 = int(request.params.get('y1'))
    # x2 = int(request.params.get('x2'))
    # y2 = int(request.params.get('y2'))

    toRet = ""
    for z in video.videos:
        toRet += json.dumps(z.__dict__)
        toRet += ","
    toRet = toRet[:-1]
    toRet = '{"video_array":[' + toRet + "]}"
    print toRet
    return toRet


@get("/hello/:name")
def index(name="World"):
    print dir(request)
    return "<b>Hello %s!</b>" % name
Пример #6
0
 def updateWorld(self, interval):
     """Update the objects in the world"""
     for zone in self.zones:
         if zone.active:
             zone.updateZone(interval, self)