コード例 #1
0
def setup():
    global runs
    global iterations
    global path
    global name
    env_setup.setup()
    path = os.environ['PY_PATH']
    iterations = raw_input('Number of interations:')
    name = raw_input('Enter name of device:')
    runs = 0
    print mcu.img_list(name)
コード例 #2
0
"""
The configuration file used by :py:mod:`agar.config` implementations and other libraries using the
`google.appengine.api.lib_config`_ configuration library. Configuration overrides go in this file.
"""
from env_setup import setup; setup()

##############################################################################
# AGAR SETTINGS
##############################################################################

# Root level WSGI application modules that 'agar.url.uri_for()' will search
agar_url_APPLICATIONS = ['main']
コード例 #3
0
ファイル: main.py プロジェクト: nickbauman/robotracker
import env_setup; env_setup.setup()

from webapp2 import RequestHandler
from google.appengine.ext import ndb

from django.template import add_to_builtins
add_to_builtins('agar.django.templatetags')

from agar.django.templates import render_template
from models import Robot


class MainHandler(RequestHandler):
    def get(self):
        # CALLING ALL ROBOTS!
        all_robot_keys = Robot.query().order(Robot.created).fetch(keys_only=True)
        all_robots = ndb.get_multi(all_robot_keys) # all gets seed memcache
        render_template(self.response, 'index.html', {"robots": all_robots})

コード例 #4
0
ファイル: routes.py プロジェクト: nickbauman/robotracker
import env_setup;

env_setup.setup()

# DO NOT REMOVE
# Importing deferred is a work around to this bug.
# https://groups.google.com/forum/?fromgroups=#!topic/webapp2/sHb2RYxGDLc
from google.appengine.ext import deferred

from webapp2 import Route, WSGIApplication

# from agar.django.templates import render_template
from agar.env import on_production_server


# from django.template import add_to_builtins
# add_to_builtins('agar.django.templatetags')
# add_to_builtins('custom_tags.custom_tags')


# def handle_403(request, response, exception):
# logging.exception(exception)
#     # response.write('You are not authorized to view this page!')
#     response.set_status(403)
#     render_template(response, '403_error.html')


# def handle_404(request, response, exception):
#     logging.exception(exception)
#     # response.write('Oops! I could swear this page was here!')
#     response.set_status(404)