- print >> sys.stdout, ('Create new playlist: %s' % self.pls_path)
- open(self.pls_path, 'a').close()
-
- def _controls_perm(self):
- if not access(dirname(self.pls_path), F_OK):
- sys.stderr.write('Error: Not existing path: "%s"' % self.pls_path)
- sys.exit(1)
- if not access(self.pls_path, W_OK):
- sys.stderr.write('Error: No write access to path: "%s"' % self.pls_path)
- sys.exit(1)
- if not isfile(self.pls_path):
- sys.stderr.write('Error: Not a regular file: "%s"' % self.pls_path)
- sys.exit(1)
- return True
+ print >> sys.stdout, ('Create new playlist: %s' % self.playlist)
+ open(self.playlist, 'a').close()
+ else:
+ self._check_dupes()
+ fd = open(self.playlist, 'a')
+ fd.write(self.current_song.get('file') + '\n')
+ fd.close()