add setup.py
This commit is contained in:
parent
0fea573dee
commit
3e0078dcc8
4 changed files with 67 additions and 2 deletions
31
bin/0xCD
Executable file
31
bin/0xCD
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
#!/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
|
||||
import oxcd.itunes
|
||||
import oxcd.rhythmbox
|
||||
|
||||
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())
|
||||
parser.add_option('-r', '--rhythmbox', dest='rhythmbox', help='Rhythmbox xml', default=oxcd.rhythmbox.path())
|
||||
(opts, args) = parser.parse_args()
|
||||
|
||||
if None in (opts.port, ) or not filter(None, (opts.itunes, opts.rhythmbox)):
|
||||
parser.print_help()
|
||||
sys.exit()
|
||||
if opts.itunes:
|
||||
backend = oxcd.itunes.iTunes(opts.itunes)
|
||||
elif opts.rhythmbox:
|
||||
backend = oxcd.rhythmbox.Rhythmbox(opts.rhythmbox)
|
||||
oxcd.main(opts.port, backend)
|
||||
Loading…
Add table
Add a link
Reference in a new issue