Beispiel #1
0
def web_input_request_method(request, *required, **kwargs):
    """
    Callable that processes the pyramid request.params multidict into a web.py storage object
    in the style of web.input().
    TODO: Replace usages of this method with accessing request directly.

    @param request: The pyramid request object.
    @param kwargs: Default values. If a default value is a list, it indicates that multiple
        values of that key should be collapsed into a list.
    @return: A dictionary-like object in the fashion of web.py's web.input()
    """
    return storify(request.params.mixed(), *required, **kwargs)
Beispiel #2
0
def web_input_request_method(request, *required, **kwargs):
    """
    Callable that processes the pyramid request.params multidict into a web.py storage object
    in the style of web.input().
    TODO: Replace usages of this method with accessing request directly.

    @param request: The pyramid request object.
    @param kwargs: Default values. If a default value is a list, it indicates that multiple
        values of that key should be collapsed into a list.
    @return: A dictionary-like object in the fashion of web.py's web.input()
    """
    return storify(request.params.mixed(), *required, **kwargs)
Beispiel #3
0
    def GET(self):
        if db is None:
            web.header('content-type', 'text/html')
            return ('MongoDB connection is not available.'
                    ' Make sure mongos is running on this host.')

        jobs = [storify(j) for j in db.jobconfs.find()]

        db.connection.end_request()
        
        web.header('content-type', 'text/html')
        return self.render('status', jobs)
Beispiel #4
0
# Image root for the website. HTTP user needs write access here
img_root = 'static/img/mrow'

# Assuming that the base for the API and website are both the directory
# that this config file is in. Can be changed if needed
dir_base, api_path = path.split(path.dirname(__file__))

# web.storage object to store the feeding times. There are one or more feeding
# cycles. You can call each time anything. Each cycle must have a "start" and an
# "end" time, between which times the cat can be fed once.
nom_cycles = utils.storify({
    'morning': {
        'start': '05:00',
        'end': '07:00',
    },
    'evening': {
        'start': '17:00',
        'end': '19:00',
    },
})

######### Camera Settings ###########

# Type of camera to use. Currently only 'usb' and 'http' cameras are supported
camera_type = "http"

# Settings for USB cameras. Leave at default settings if not using USB camera
# USB camera port #, e.g. /dev/video0 would be port '0'
camera_port = 0

# Settings for HTTP cameras. Leave at default settings if not using an HTTP
Beispiel #5
0
# Image root for the website. HTTP user needs write access here
img_root = 'static/img/mrow'

# Assuming that the base for the API and website are both the directory
# that this config file is in. Can be changed if needed
dir_base, api_path = path.split(path.dirname(__file__))

# web.storage object to store the feeding times. There are one or more feeding
# cycles. You can call each time anything. Each cycle must have a "start" and an
# "end" time, between which times the cat can be fed once.
nom_cycles = utils.storify({
    'morning': {
        'start': '05:00',
        'end': '07:00',
    },
    'evening': {
        'start': '17:00',
        'end': '19:00',
    },
})

######### Camera Settings ###########

# Type of camera to use. Currently only 'usb' and 'http' cameras are supported
camera_type = "http"

# Settings for USB cameras. Leave at default settings if not using USB camera
# USB camera port #, e.g. /dev/video0 would be port '0'
camera_port = 0

# Settings for HTTP cameras. Leave at default settings if not using an HTTP