コード例 #1
0
ファイル: dbcleanup.py プロジェクト: ghengeveld/PopiView
def cleanup():
    options, args = parser.parse_args()
    if not options.config_file:
        print "Required option: --config-file"
        exit(1)
    if not os.path.isfile(options.config_file):
        print "Invalid value for option --config-file"
        exit(1)
    config = appconfig('config:' + options.config_file, relative_to=os.getcwd())
    config = ConfigParser(config)
    storage = SQLStorage(config)
    storage.clear_hits(int(options.days))