/usr/bin/mbsubmit is in ears 1.0.1-2.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #!/usr/bin/python
import sys
import os
import webbrowser
try:
import musicbrainz
except ImportError, e:
print >>sys.stderr, 'import: %s' % e
sys.exit(1)
if __name__ == '__main__':
mb = musicbrainz.mb()
mb.Query(musicbrainz.MBQ_GetCDTOC)
cdid = mb.GetResultData(musicbrainz.MBE_TOCGetCDIndexId)
mb.QueryWithArgs(musicbrainz.MBQ_GetCDInfoFromCDIndexId, [cdid])
if mb.GetResultInt(musicbrainz.MBE_GetNumAlbums) == 0:
url = mb.GetWebSubmitURL()
if url:
webbrowser.open_new(url)
else:
print >>sys.stderr, 'musicbrainz: no url received from server'
sys.exit(1)
else:
print >>sys.stderr, 'musicbrainz: discid is already entered'
sys.exit(2)
|