diff --git a/bin/pandora_client b/bin/pandora_client new file mode 100755 index 0000000..30c7796 --- /dev/null +++ b/bin/pandora_client @@ -0,0 +1,41 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# vi:si:et:sw=4:sts=4:ts=4 +# GPL 2008 + +import os +import sys +from optparse import OptionParser + +root = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') +if os.path.exists(os.path.join(root, 'pandora_client')): + sys.path.insert(0, root) + + +import pandora_client + +if __name__ == '__main__': + usage = "usage: %prog [options] action" + parser = OptionParser(usage=usage) + parser.add_option('-c', '--config', dest='config', help='config.json containing config', default='~/.ox/client.json', type='string') + (opts, args) = parser.parse_args() + + opts.config = os.path.expanduser(opts.config) + if None in (opts.config, ) or not os.path.exists(opts.config): + parser.print_help() + sys.exit() + + if not args or args[0] not in ('scan', 'sync', 'clean'): + parser.error('you must specify a valid action. \n\t\tknown actions are: scan, sync, clean') + + action = args[0] + + c = pandora_client.Client(opts.config) + if action == 'scan': + c.scan() + if action == 'sync': + c.sync() + if action == 'clean': + c.clean() + + diff --git a/setup.py b/setup.py index 30dd7c1..c479aa4 100644 --- a/setup.py +++ b/setup.py @@ -13,9 +13,10 @@ def get_bzr_version(): setup( name="pandora_client", version="1.0.%s" % get_bzr_version() , - description='''pandora_client - headless archive client for pan.do/ra + description='''pandora_client - commandline client and python api for pan.do/ra -can be used instead of OxFF to keep archive and pan.do/ra instance in sync. +can be used interact with pan.do/ra instance via its api. +or instead of OxFF to keep archive and pan.do/ra instance in sync. ''', author="j", author_email="j@mailb.org",