forked from upstream/IPod-Shuffle-4g
Remove redundant self.base
This commit is contained in:
parent
21eba1e2be
commit
e6303ad964
1 changed files with 3 additions and 9 deletions
12
shuffle.py
12
shuffle.py
|
|
@ -207,7 +207,7 @@ class Record(object):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def base(self):
|
def base(self):
|
||||||
return self.shuffledb.base
|
return self.shuffledb.path
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tracks(self):
|
def tracks(self):
|
||||||
|
|
@ -534,7 +534,7 @@ class Playlist(Record):
|
||||||
|
|
||||||
class Shuffler(object):
|
class Shuffler(object):
|
||||||
def __init__(self, path, voiceover=False, playlist_voiceover=False, rename=False, trackgain=0, auto_playlists=None):
|
def __init__(self, path, voiceover=False, playlist_voiceover=False, rename=False, trackgain=0, auto_playlists=None):
|
||||||
self.path, self.base = self.determine_base(path)
|
self.path = os.path.abspath(path)
|
||||||
self.tracks = []
|
self.tracks = []
|
||||||
self.albums = []
|
self.albums = []
|
||||||
self.artists = []
|
self.artists = []
|
||||||
|
|
@ -560,12 +560,6 @@ class Shuffler(object):
|
||||||
print "Artists", self.artists
|
print "Artists", self.artists
|
||||||
print "Playlists", self.lists
|
print "Playlists", self.lists
|
||||||
|
|
||||||
def determine_base(self, path):
|
|
||||||
base = os.path.abspath(path)
|
|
||||||
# while not os.path.ismount(base):
|
|
||||||
# base = os.path.dirname(base)
|
|
||||||
return base, base
|
|
||||||
|
|
||||||
def populate(self):
|
def populate(self):
|
||||||
self.tunessd = TunesSD(self)
|
self.tunessd = TunesSD(self)
|
||||||
for (dirpath, dirnames, filenames) in os.walk(self.path):
|
for (dirpath, dirnames, filenames) in os.walk(self.path):
|
||||||
|
|
@ -588,7 +582,7 @@ class Shuffler(object):
|
||||||
self.lists.append(os.path.abspath(dirpath))
|
self.lists.append(os.path.abspath(dirpath))
|
||||||
|
|
||||||
def write_database(self):
|
def write_database(self):
|
||||||
with open(os.path.join(self.base, "iPod_Control", "iTunes", "iTunesSD"), "wb") as f:
|
with open(os.path.join(self.path, "iPod_Control", "iTunes", "iTunesSD"), "wb") as f:
|
||||||
f.write(self.tunessd.construct())
|
f.write(self.tunessd.construct())
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue