#!/bin/env python
 
import AccountingReports,datetime,sys

def main(argv=None):
    AccountingReports.UseArgs(argv)

    if not AccountingReports.CheckDB() :
        return 1

    argOutput = AccountingReports.gOutput
    if (argOutput == "all"):
       text = {}
       for iterOutput in ("text","csv","html"):
          text[iterOutput] = AccountingReports.NonReportingSites(when = AccountingReports.gBegin, output=iterOutput) # datetime.date(2008,02,01))
       AccountingReports.sendAll(text)
    else:
       print AccountingReports.NonReportingSites(when = AccountingReports.gBegin, output=argOutput) # datetime.date(2008,02,01))

if __name__ == "__main__":
    sys.exit(main())
