finished base version 1.0 and as such the app is fully functional though there might still be bugs around and also some improvements will be made later on
This commit is contained in:
26
bin/filepathanalysis.py
Normal file
26
bin/filepathanalysis.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
|
||||
|
||||
class PathAnalysis:
|
||||
def __init__(self):
|
||||
self.__output = []
|
||||
self.__input = []
|
||||
self.__file_extension = ""
|
||||
self.__filepath = ""
|
||||
self.__returns = []
|
||||
self.__names = []
|
||||
|
||||
def validsonglistcreator(self, path):
|
||||
self.__input = os.listdir(path)
|
||||
for self.item in self.__input:
|
||||
self.__file_extension = self.item[(len(self.item) - 4):]
|
||||
if self.__file_extension == ".mp3" or self.__file_extension == ".wav":
|
||||
self.__filepath = str(path)
|
||||
self.__filepath += f"/{str(self.item)}"
|
||||
self.__names.append(self.item)
|
||||
self.__output.append(self.__filepath)
|
||||
else:
|
||||
pass
|
||||
self.__returns.append(self.__output)
|
||||
self.__returns.append(self.__names)
|
||||
return self.__returns
|
||||
Reference in New Issue
Block a user