Beispiel #1
0
 def __initSaintRaphHouse(self):
     house = House.initSaintRaph()
     
     self.lightCommands = [] 
     for lightModel in house.lightModels:
         self.lightCommands.append(LightCommand(lightModel, 
                                            self.__getSerial()))    
     
     self.shutterCommands = []
     for shutterModel in house.shutterModels:
         self.shutterCommands.append(ShutterCommand(shutterModel, 
                                            self.__getSerial()))  
Beispiel #2
0
import cgi
import httplib, urllib
import logging

from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
import os
from google.appengine.ext.webapp import template

from houses.house import House

IP = '127.0.0.1'
PORT = 8000
house = House.initSaintRaph()

class MainPage(webapp.RequestHandler):
    def get(self):
        if users.get_current_user():
            url = users.create_logout_url(self.request.uri)
            url_linktext = 'Logout'
        else:
            url = users.create_login_url(self.request.uri)
            url_linktext = 'Login'

        template_values = {
            'url': url,
            'url_linktext': url_linktext,
            'house': house
        }