add rhythmbox backend
This commit is contained in:
parent
1f2dd79517
commit
304675110a
6 changed files with 129 additions and 45 deletions
16
bin/0xcd
16
bin/0xcd
|
|
@ -11,14 +11,24 @@ 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('-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, opts.itunes):
|
||||
print (opts.port, )
|
||||
print not filter(None, (opts.itunes, opts.rhythmbox))
|
||||
|
||||
if None in (opts.port, ) or not filter(None, (opts.itunes, opts.rhythmbox)):
|
||||
parser.print_help()
|
||||
sys.exit()
|
||||
oxcd.main(opts.port, opts.itunes)
|
||||
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