-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·69 lines (66 loc) · 2.37 KB
/
main.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/python
import os, sys
import time
import inquirer
from code.convert import *
from code.helper.utils import *
from code.helper.imageTools import *
from code.helper.utils import *
from code.helper.fancy import *
from code.helper.threading import *
from code.helper.exif_data import *
def main():
# path = 'test_folder/' # debug only
path = '/media/' # production
# display_banner()
# selection_program()
# os_check()
# time.sleep(5)
clear()
question = [inquirer.List('selection',
message=" Main machine interface, what do you wish to do?",
choices=['Convert multimedia data to JPEG images', 'Beta test a function', 'Exit'],
),]
answer = inquirer.prompt(question)
print(answer['selection'])
a = answer['selection']
if a == 'Convert multimedia data to JPEG images':
clear()
# data_processing_banner()
print('Converting multimedia data to JPEG images')
fps = choose_framerate()
for file in os.listdir(path):
# print(file)
if file.endswith('.mp4') or file.endswith('.MP4'):
# print(file)
print('Converting video to image series (saved to subfolder)')
path2 = convertAVideoToImage(file, path, fps)
print('Video converted')
Exif_origin = choose_meta(path)
print('Copying metadata')
iterate_meta_copy(path2, Exif_origin)
# end_program()
elif file.endswith('.jpg') or file.endswith('.png') or file.endswith('.tiff') or file.endswith('.bmp'):
convert(path, False)
print('Images converted')
# end_program()
elif file.endswith('.ARW') or file.endswith('.arw'):
pass
else:
print('File type not supported')
elif a == 'Beta test a function':
clear()
beta_banner()
error_banner()
print(bcolors.ERROR + 'Function not yet implemented')
reset_color()
elif a == 'Exit':
clear()
end_program()
else:
print('Invalid selection')
time.sleep(2)
main()
if __name__ == '__main__':
os.system('export TERM=xterm-256color')
main()