-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetInfo.py
38 lines (26 loc) · 1.07 KB
/
getInfo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import fileFunctions as ff
import sysFunctions as sf
def getInfo(folderIn: str, folderOut: str) -> int:
"""
Gets file info and writes it to a file.
folderIn : str
Folder being processed.
folderOut: str
Folder to which an output file is written.
Returns 0.
"""
sf.limitTracebackInfo(0) # limit traceback info
ff.dirCheck(folderIn) # check "folderIn" correctness
ff.dirCheck(folderOut) # check "folderOut" correctness
fileName, fullName = ff.listFiles(folderIn, True) # list files in directory
bitrateType, kbps, title, artist = \
ff.getMetadata(fullName) # get metadata from filelist
fileSize = ff.getFileSize(fullName) # get the size of the files
extensions = ff.getFileExtension(fileName) # get files extensions
ff.writeData(folderIn, fullName, fileName, extensions, bitrateType, kbps,
title, artist, fileSize, folderOut) # write data to a file
return 0
if __name__ == '__main__':
folder = r'/mnt/Internal_HDD/0_FROM_EXTERNAL/music/'
out = r'/home/linux/Downloads/convert/'
print(getInfo(folder, out))