oxcd/bin/0xcd

25 lines
687 B
Text
Raw Normal View History

2012-09-06 10:08:30 +00:00
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
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, 'oxcd')):
sys.path.insert(0, root)
import oxcd
if __name__ == '__main__':
parser = OptionParser()
parser.add_option('-p', '--port', dest='port', help='port', default=2681)
parser.add_option('-i', '--itunes', dest='itunes', help='iTunes xml', default=oxcd.itunes_path())
(opts, args) = parser.parse_args()
if None in (opts.port, opts.itunes):
parser.print_help()
sys.exit()
oxcd.main(opts.port, opts.itunes)