Skip to content

Commit

Permalink
Review: Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
MartyLake committed Jul 23, 2019
1 parent 68ccfe0 commit 0080c24
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion beets/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def sorted_walk(path, ignore=(), ignore_hidden=False, logger=None):
for res in sorted_walk(cur, ignore, ignore_hidden, logger):
yield res

def pathlib_as_posix(path):
def path_as_posix(path):
"""Return the string representation of the path with forward (/)
slashes.
"""
Expand Down
6 changes: 3 additions & 3 deletions beetsplug/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import fnmatch
import tempfile
import beets
from beets.util import pathlib_as_posix
from beets.util import path_as_posix


class PlaylistQuery(beets.dbcore.Query):
Expand Down Expand Up @@ -163,7 +163,7 @@ def update_playlist(self, filename, base_dir):
new_path = self.changes[beets.util.normpath(lookup)]
except KeyError:
if self.config['forward_slash']:
line = pathlib_as_posix(line)
line = path_as_posix(line)
tempfp.write(line)
else:
if new_path is None:
Expand All @@ -176,7 +176,7 @@ def update_playlist(self, filename, base_dir):
new_path = os.path.relpath(new_path, base_dir)
line = line.replace(original_path, new_path)
if self.config['forward_slash']:
line = pathlib_as_posix(line)
line = path_as_posix(line)
tempfp.write(line)

if changes or deletions:
Expand Down
4 changes: 2 additions & 2 deletions beetsplug/smartplaylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from beets.plugins import BeetsPlugin
from beets import ui
from beets.util import (mkdirall, normpath, sanitize_path, syspath,
bytestring_path, pathlib_as_posix)
bytestring_path, path_as_posix)
from beets.library import Item, Album, parse_query_string
from beets.dbcore import OrQuery
from beets.dbcore.query import MultipleSort, ParsingError
Expand Down Expand Up @@ -208,7 +208,7 @@ def update_playlists(self, lib):
with open(syspath(m3u_path), 'wb') as f:
for path in m3us[m3u]:
if self.config['forward_slash'].get():
path = pathlib_as_posix(path)
path = path_as_posix(path)
f.write(path + b'\n')

self._log.info(u"{0} playlists updated", len(self._matched_playlists))

0 comments on commit 0080c24

Please sign in to comment.