#!/usr/bin/env python
"""An executable that submits unsubmitted data from sql to the friskby cloud.

Marks uploaded data in dao as such.

"""
from __future__ import print_function
import sys
from friskby import FriskbySubmitter, FriskbyDao

if __name__ == '__main__':
    # TODO should take config file, and config file should contain path to sql
    # file and also sample time, etc.
    if len(sys.argv) > 1:
        DAO = FriskbyDao(sys.argv[1])
        SUB = FriskbySubmitter(DAO)
        SUB.post()
    else:
        sys.stderr.write('Please specify database file.\n')
