Ejemplo n.º 1
0
import sys
import os
os.chdir('/var/www/mowmow/')
sys.path.append('/var/www/mowmow/')
sys.path.append('/var/www/mowmow/mowlib/')
import mow_utils
import config
from web import utils

status = mow_utils.get_status(None)

if status['fed']:
    print('Already fed')
else:
    print('Feeding')
    data = utils.storage(feed=1)
    print(
        mow_utils.feed_cycle(data,
                             mow_utils.date_strings(),
                             None,
                             external=True))
Ejemplo n.º 2
0
 def GET(self):
     auth_token = web.cookies().get('auth_token')
     web.header('cache-control', 'max-age=0')
     return json.dumps(mow_utils.get_status(auth_token),
                       cls=mow_utils.webpy_db_encoder)
Ejemplo n.º 3
0
 def GET(self):
     auth_token = web.cookies().get('auth_token')
     web.header('cache-control', 'max-age=0')
     return json.dumps(mow_utils.get_status(auth_token),
             cls=mow_utils.webpy_db_encoder)
Ejemplo n.º 4
0
import sys
import os
os.chdir('/var/www/mowmow/')
sys.path.append('/var/www/mowmow/')
sys.path.append('/var/www/mowmow/mowlib/')
import mow_utils
import config
from web import utils

status = mow_utils.get_status(None)

if status['fed']:
    print('Already fed')
else:
    print('Feeding')
    data = utils.storage(feed = 1)
    print(mow_utils.feed_cycle(data, mow_utils.date_strings(), None, external=True))