Skip to content

Commit

Permalink
release v1.0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanslack committed Jan 24, 2023
1 parent 26e1874 commit 885bbdf
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 34 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
+--------------------------------+
January 19 2023 Version 1.0.19 Beta (unreleased)
January 24 2023 Version 1.0.19 Beta
+--------------------------------+

- Added opus codec/format, thanks to @tsweet (Tim Sweet)
- Update man page
- Update wiki
- Fixed typos on printed strings.

+--------------------------------+
January 11 2023 Version 1.0.18 Beta
Expand Down
14 changes: 7 additions & 7 deletions ffcuesplitter/cuesplitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,17 @@ def __init__(self,
output format, one of
("wav", "flac", "mp3", "ogg", "opus", "copy") .
overwrite:
overwriting options, one of "ask", "never", "always".
overwriting options, one of ("ask", "never", "always").
ffmpeg_cmd:
an absolute path command of ffmpeg
ffmpeg_loglevel:
one of "error", "warning", "info", "verbose", "debug" .
one of ("error", "warning", "info", "verbose", "debug") .
ffprobe_cmd:
an absolute path command of ffprobe.
ffmpeg_add_params:
additionals parameters of FFmpeg.
progress_meter:
one of 'tqdm', 'standard', default is 'standard'.
one of ('tqdm', 'standard'), default is 'standard'.
dry:
with `True`, perform the dry run with no changes
done to filesystem.
Expand Down Expand Up @@ -318,14 +318,14 @@ def deflacue_object_handler(self):
track_file = track[1].file.path

if not track_file.exists():
msgdebug(warn=(f'Source file `{track_file}` is not '
f'found. Track is skipped.'))
msgdebug(warn=(f'Not found: `{track_file}`. '
f'Track is skipped.'))

if str(track_file) in sourcenames:
sourcenames.pop(str(track_file))
if not sourcenames:
raise FFCueSplitterError('No other audio source '
'files found here!')
raise FFCueSplitterError('No other audio tracks '
'found here.')
continue

filename = (f"{sanitize(track[1].title)}") # title names sanitize
Expand Down
26 changes: 13 additions & 13 deletions ffcuesplitter/ffprobe.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ def from_kwargs_to_args(kwargs):

def ffprobe(filename, cmd='ffprobe', **kwargs):
"""
Run ffprobe on the specified file and return a
JSON representation of the output.
Run ffprobe subprocess on the specified file.
Raises:
:class:`ffcuesplitter.FFProbeError`: if ffprobe
returns a non-zero exit code;
`ffcuesplitter.FFProbeError` from `OSError`,
`FileNotFoundError` if a generic error.
`FFProbeError` from `FileNotFoundError` or from `OSError`.
`FFProbeError` if non-zero exit code from `proc.returncode`.
Return:
A JSON representation of the ffprobe output.
Usage:
ffprobe(filename,
cmd='/usr/bin oi/ffprobe',
loglevel='error',
hide_banner=None,
etc,
)
>>> from ffcuesplitter.ffprobe import ffprobe
>>> probe = ffprobe(filename,
cmd='/usr/bin/ffprobe',
loglevel='error',
hide_banner=None,
kwargs,
)
"""
args = (f'"{cmd}" -show_format -show_streams -of json '
f'{" ".join(from_kwargs_to_args(kwargs))} '
Expand Down
2 changes: 1 addition & 1 deletion ffcuesplitter/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
__maintainer_contact__ = "[email protected]"
__copyleft__ = '2023'
__version__ = '1.0.19'
__release__ = 'January 20 2023'
__release__ = 'January 24 2023'
__appname__ = "FFcuesplitter"
__packagename__ = "ffcuesplitter"
__license__ = "GPL3 (Gnu Public License)"
Expand Down
20 changes: 8 additions & 12 deletions ffcuesplitter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Writer: jeanslack <[email protected]>
license: GPL3
Copyright: (C) 2023 Gianluca Pernigotto <[email protected]>
Rev: Dec 27 2022
Rev: Jan 24 2023
Code checker: flake8 and pylint
####################################################################
Expand Down Expand Up @@ -37,11 +37,10 @@ def sanitize(string: str = 'string') -> str:
with the OS file system.
- On Windows, removes the following illegal chars: " * : < > ? / \ |
and replaces slash (/) character with hyphen (-).
- On other operating systems, it replaces slash (/) character
with hyphen (-).
- On all operating systems, removes leading/trailing spaces
and dots (.).
- On all operating systems, it replaces slash (/) character
with hyphen (-) and removes leading/trailing spaces
and dots (.)
Returns the new sanitized string.
Expand All @@ -51,9 +50,7 @@ def sanitize(string: str = 'string') -> str:

if platform.system() == 'Windows':
string = re.sub(r"[\"\*\:\<\>\?\|\\]", '', string)
string = string.replace('/', '-')
else:
string = string.replace('/', '-')
string = string.replace('/', '-')

return string.strip().strip('.') # removes spaces and dots
# ------------------------------------------------------------------------
Expand Down Expand Up @@ -101,7 +98,7 @@ def frames_to_seconds(frames):

def makeoutputdirs(outputdir):
"""
Makes the subfolders specified in the outpudir argument
Makes the specified subfolders in the outpudir
"""
try:
os.makedirs(outputdir,
Expand All @@ -115,7 +112,7 @@ def makeoutputdirs(outputdir):

class Popen(subprocess.Popen):
"""
Inherit subprocess.Popen class to set _startupinfo.
Inherit `subprocess.Popen` class to set `_startupinfo`.
This avoids displaying a console window on MS-Windows
using GUI's .
"""
Expand Down Expand Up @@ -190,7 +187,6 @@ def find_files_recursively(self, suffix: str = '') -> dict:
if os.path.exists(dirs):
if os.path.isdir(dirs):
for root, alldirs, allfiles in os.walk(dirs):
# to disable some `for` variables put underscore _
fileswalk[root] = list(alldirs + allfiles)
else:
self.rejected.append(dirs) # only existing files
Expand Down

0 comments on commit 885bbdf

Please sign in to comment.