Codebase list isrcsubmit / 72c9de4
Imported Upstream version 2.0.1 Sebastian Ramacher 8 years ago
11 changed file(s) with 79 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
2121 Ulrich Klauer
2222 Jim Patterson
2323 - minor fixes
24
25 Ville Skyttä
26 - mocking fix for the tests
0 ### Changes in 2.0.1 (2015-06-06)
1 * [#94] also install isrcsubmit-config.5
2 * [#93] fix name 'FileNotFoundError' is not defined
3 * [#96] fix display of "missing backend" error
4 * [#98] be case insensitive for Y/N prompts
5
06 ### Changes in 2.0.0 (2014-05-05)
17 * [#59] use libdiscid as isrc backend
28 * [#6] use the NGS (WS/2) web service
00 #version := 2.1.0-dev
1 version := 2.0.0
1 version := 2.0.1
22
33 build:
44 ./setup.py build
0 Isrcsubmit 2.0.0 for MusicBrainz
1 ====================================
0 Isrcsubmit 2.0.1 for MusicBrainz
1 ================================
22
33 This python script extracts ISRCs_ from audio CDs
44 and submits them to MusicBrainz_.
125125 The core of the MusicBrainz dataset including the ISRC contributions is placed
126126 into the Public Domain.
127127
128 For a documentation of the available backends please refer to the manual
129 or the `web page`_.
130
128131 You might find additional information about this script at the
129132 `MusicBrainz forums`_.
130133
134 .. _web page: http://jonnyjd.github.io/musicbrainz-isrcsubmit/backends
131135 .. _MusicBrainz forums: http://forums.musicbrainz.org/viewtopic.php?id=3444
132136
133137
4343
4444 # General information about the project.
4545 project = u'isrcsubmit'
46 copyright = u'2010-2013, Johannes Dewender'
46 copyright = u'2009-2015, Johannes Dewender'
4747
4848 # The version info for the project you're documenting, acts as replacement for
4949 # |version| and |release|, also used in various other places throughout the
1111 -----------
1212
1313 The configuration file contains various options controlling the behavior of
14 :program:`isrcsubmit`. All the options given here can be overriden by passing
14 :program:`isrcsubmit`. All the options given here can be overridden by passing
1515 command line arguments to :program:`isrcsubmit`.
1616
1717 If **$XDG_CONFIG_HOME** is not set, **%APPDATA%** is used on Windows
3333 -b <program>, --backend=<program>
3434 Force using a specific backend to extract ISRCs from the disc. Possible
3535 backends are: mediatools, media_info, cdrdao, libdiscid, discisrc. They are
36 tried in this order otherwise.
36 tried in this order otherwise. See also :strong:`BACKENDS`.
3737 --browser=<browser>
3838 Program to open URLs. This will be automatically deteced for most setups,
3939 if not chosen manually.
4646 --no-keyring
4747 Do not use keyring.
4848
49 Backends
50 --------
51
52 :program:`isrcsubmit` is able to use various backends to extract the ISRC.
53 The **libdiscid** library is a requirement for isrcsubmit
54 and can also be used as a backend on most systems.
55
56 ISRCs are nearly always stored in the subchannel information
57 and all tools read them from there.
58 However, some drives tend to extract the same ISRC for adjacent tracks.
59 Restarting the script might help and using a different drive might help.
60 CD writers are reported to give better results than many CD reader drives.
61
62 mediatools, media_info
63 These tools use an experimental algorithm to gather ISRCs from the disc.
64 This should give less duplicates on the same drive than with other tools.
65 However, there might be other problems. (only available for Windows)
66
67 cdrdao
68 This tool can read ISRCs from CD-Text if no ISRCs are in the subchannel
69 information.
70 This is rarely the case. Most ISRCs are stored in the subchannel.
71 (usually available on Linux, but there are also Windows builds (plank))
72
73 libdiscid
74 Starting with **libdiscid** 0.3.0 this can be used not only for
75 the disc ID, but also to extract ISRCs.
76 (Windows, Mac; Linux support with 0.3.1)
77
78 discisrc
79 The **discisrc** binary is created from source builds of **libdiscid**.
80 There is an experimental branch *isrc_raw* that might give
81 better results regarding duplicate ISRCs on Linux.
82 You can use this binary separately without installing
83 an experimental libdiscid library on the system.
84
85
4986 See also
5087 --------
5188
5491 Author
5592 ------
5693
57 This manual page was written by Sebastian Ramacher. :program:`isrcsubmit` was
58 written by Johannes Dewender.
94 This manual was written by Sebastian Ramacher and Johannes Dewender.
95 :program:`isrcsubmit` was written by Johannes Dewender.
00 #!/usr/bin/env python
1 # Copyright (C) 2010-2013 Johannes Dewender
1 # Copyright (C) 2009-2015 Johannes Dewender
22 #
33 # This program is free software: you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
2020 https://github.com/JonnyJD/musicbrainz-isrcsubmit
2121 """
2222
23 __version__ = "2.0.0"
23 __version__ = "2.0.1"
2424 AGENT_NAME = "isrcsubmit.py"
2525 DEFAULT_SERVER = "musicbrainz.org"
2626 # starting with highest priority
368368 if backend is None:
369369 print_error("Cannot find a backend to extract the ISRCS!",
370370 "Isrcsubmit can work with one of the following:",
371 " " + ", ".join(backend))
371 " " + ", ".join(BACKENDS))
372372 sys.exit(-1)
373373
374374 return backend
409409 else:
410410 with open(os.devnull, "w") as devnull:
411411 Popen([options.browser, url], stdout=devnull)
412 except FileNotFoundError as err:
412 except OSError as err:
413413 error = ["Couldn't open the url in %s: %s"
414414 % (options.browser, str(err))]
415415 if submit:
548548 submit_requested = True
549549 else:
550550 printf("Would you like to open the browser to submit the disc?")
551 submit_requested = user_input(" [y/N] ") == "y"
551 submit_requested = user_input(" [y/N] ").lower() == "y"
552552
553553 if submit_requested:
554554 open_browser(url, exit=True, submit=True)
996996 if duplicates > 0:
997997 printf("\nThere were %d ISRCs ", duplicates)
998998 print("that are attached to multiple tracks on this release.")
999 if user_input("Do you want to help clean those up? [y/N] ") == "y":
999 choice = user_input("Do you want to help clean those up? [y/N] ")
1000 if choice.lower() == "y":
10001001 cleanup_isrcs(release, isrcs)
10011002
10021003 def cleanup_isrcs(release, isrcs):
10361037 print("")
10371038
10381039 url = "http://%s/isrc/%s" % (options.server, isrc)
1039 if user_input("Open ISRC in the browser? [Y/n] ") != "n":
1040 if user_input("Open ISRC in the browser? [Y/n] ").lower() != "n":
10401041 open_browser(url)
10411042 user_input("(press <return> when done with this ISRC) ")
10421043
10591060 stream_handler.setLevel(logging.INFO)
10601061
10611062 # adding log file
1062 file_handler = logging.FileHandler("isrcsubmit.log", mode='w',
1063 logfile = "isrcsubmit.log"
1064 file_handler = logging.FileHandler(logfile, mode='w',
10631065 encoding="utf8", delay=True)
10641066 formatter = logging.Formatter("%(levelname)s:%(name)s: %(message)s")
10651067 file_handler.setFormatter(formatter)
10661068 file_handler.setLevel(logging.DEBUG)
1069 logger.info("Writing debug log to %s" % logfile)
10671070 logging.getLogger().addHandler(file_handler)
10681071
10691072 # add context to log file (DEBUG only added there)
11061109 else:
11071110 if errors > 0:
11081111 print_error("%d problems detected" % errors)
1109 if user_input("Do you want to submit? [y/N] ") == "y":
1112 if user_input("Do you want to submit? [y/N] ").lower() == "y":
11101113 ws2.submit_isrcs(tracks2isrcs)
11111114 else:
11121115 update_intention = False
0 version := 2.0.0
0 version := 2.0.1
11 current := isrcsubmit-$(version)
22
33 downloads := ../web/isrcsubmit.jonnyjd.net/downloads/
1717 source_branch := master
1818 source_dir := isrcsubmit
1919
20 # TODO: make sure isrcsubmit.py is really updated!
2021
2122 tag_ref := $(source_repo)/.git/refs/tags/v$(version)
2223 branch_ref := $(source_repo)/.git/refs/heads/$(source_branch)
137138 rm -rf $(base_libs)
138139 rm -rf mediatools mediatools.exe
139140
140 .PHONY: source_update
141 .PHONY: $(source_ref)
4141 import os.path
4242 man_pages = [
4343 (os.path.join(man_dir, 'man1'), ['build/man/isrcsubmit.1']),
44 (os.path.join(man_dir, 'man5'), ['build/man/isrcsubmit-config.5'])
4445 ]
4546 else:
4647 man_pages = []
9091
9192 cmdclass["test"] = Test
9293
94 with open("README.rst") as readme:
95 long_description = readme.read()
9396
9497 setup(name="isrcsubmit",
9598 version=__version__,
9699 description="submit ISRCs from disc to MusicBrainz",
97 long_description=open("README.rst").read(),
100 long_description=long_description,
98101 author="Johannes Dewender",
99102 author_email="brainz@JonnyJD.net",
100103 url="https://github.com/JonnyJD/musicbrainz-isrcsubmit",
00 #!/usr/bin/env python
1 # Copyright (C) 2013 Johannes Dewender
1 # Copyright (C) 2014 Johannes Dewender
22 # This test is free. You can redistribute and/or modify it at will.
33
44 import os
152152 with open(file_name, "rb") as disc_file:
153153 return pickle.load(disc_file)
154154
155 discid.read = _read
155 isrcsubmit.discid.read = _read
156156
157157
158158 # mock cdrdao reading