コード例 #1
0
import collections
import pycosat
import itertools

from classtime.logging import logging
logging = logging.getLogger(__name__)  # pylint: disable=C0103

import classtime

from classtime.brain.scheduling.schedule import Schedule


def find_schedules(schedule_params, num_requested):
    """
    :param dict schedule_params: parameters to build the schedule with.
        Check :ref:`api/generate-schedules <api-generate-schedules>`
        for available parameters.
    """
    logging.info('Received schedule request')

    if 'term' not in schedule_params:
        logging.error("Schedule generation call did not specify <term>")
    term = schedule_params.get('term', '')
    institution = schedule_params.get('institution', 'ualberta')
    cal = classtime.brain.get_calendar(institution)

    if 'courses' not in schedule_params:
        logging.error("Schedule generation call did not specify <courses>")
    course_ids = schedule_params.get('courses', list())
    busy_times = schedule_params.get('busy-times', list())
    preferences = schedule_params.get('preferences', dict())
コード例 #2
0
import collections
import pycosat
import itertools

from classtime.logging import logging
logging = logging.getLogger(__name__) # pylint: disable=C0103

import classtime

from classtime.brain.scheduling.schedule import Schedule


def find_schedules(schedule_params, num_requested):
    """
    :param dict schedule_params: parameters to build the schedule with.
        Check :ref:`api/generate-schedules <api-generate-schedules>`
        for available parameters.
    """
    logging.info('Received schedule request')

    if 'term' not in schedule_params:
        logging.error("Schedule generation call did not specify <term>")
    term = schedule_params.get('term', '')
    institution = schedule_params.get('institution', 'ualberta')
    cal = classtime.brain.get_calendar(institution)

    if 'courses' not in schedule_params:
        logging.error("Schedule generation call did not specify <courses>")
    course_ids = schedule_params.get('courses', list())
    busy_times = schedule_params.get('busy-times', list())
    preferences = schedule_params.get('preferences', dict())
コード例 #3
0
import os
from classtime.logging import logging
logging = logging.getLogger(__name__)

SECRET_KEY = os.environ.get('SECRET_KEY', 'debug')
if SECRET_KEY == 'debug':
    DEBUG = True
else:
    DEBUG = False

SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'sqlite:////tmp/classtime.db')
logging.info('Using SQLALCHEMY_DATABASE_URI {}'.format(SQLALCHEMY_DATABASE_URI))