Exemple #1
0
logging.config.fileConfig("logger.conf")
logger = logging.getLogger("example01")

#controller = GPIOControl.GPIOController()

urls = ("/", "hello", "/connect", "connect", "/action", "action", "/getstatus",
        "getstatus", "/stop", "stop")  # 指定任何url都指向hello类

web.config.debug = True

app_root = os.path.dirname(__file__)
templates_root = os.path.join(app_root, 'templates')
render = web.template.render(templates_root)

modeArray = [1, 2, 3]  # 自由、预设、轨迹
at = CarController.ActionTranslate()


def notfound():
    return web.notfound("Sorry, the page you were looking for was not found.")


# 定义相应类
class hello:
    def GET(self):
        logging.info('web service started.')
        return "web service started"


class connect:
    def POST(self):