diff options
| author | mikeos <mike.osipov@gmail.com> | 2013-07-25 18:20:41 +0400 |
|---|---|---|
| committer | mikeos <mike.osipov@gmail.com> | 2013-07-25 18:20:41 +0400 |
| commit | fe3fc0c3c556e1925c6c545d28f89f41d7148e23 (patch) | |
| tree | cdf564a7569e5216c0483a17d97037cb4a80032e | |
| parent | 8eaba4017a519a9289ccdb4bd50eb0588741df92 (diff) | |
search cue in specified dir if cutter's argument is dir
| -rwxr-xr-x | cutter | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -587,6 +587,15 @@ class CueSplitter: trackname = self.track_name(track) printf("%s\n", os.path.join(self.dest, trackname)) +def find_cuefile(path): + for file in os.listdir(path): + fullname = os.path.join(path, file) + if os.path.isfile(fullname) and file.endswith(".cue"): + return fullname + + printerr("no cue file") + sys.exit(1) + def main(): options, args = parse_args() process_options(options) @@ -601,6 +610,11 @@ def main(): raise StopIteration cuepath = to_unicode(args[0]) + if os.path.isdir(cuepath): + cuepath = find_cuefile(cuepath) + if options.dry_run: + debug("use cue file %s", quote(cuepath)) + try: cue = read_cue(cuepath, on_error=on_error) except StopIteration: |
