37 lines
791 B
Python
37 lines
791 B
Python
#!/usr/bin/python
|
|
import os, sys
|
|
|
|
group_start = 1
|
|
group_end = 18
|
|
device_start = 1
|
|
device_end = 6
|
|
devices = {}
|
|
|
|
for group in range(group_start, group_end + 1):
|
|
for device in range(device_start, device_end + 1):
|
|
device_id = str(group*10 + device)
|
|
devices[device_id] = 0
|
|
|
|
if len(sys.argv) < 2:
|
|
path = '.'
|
|
else:
|
|
path = sys.argv[1]
|
|
|
|
path = os.path.abspath(path)
|
|
print('checking path: ' + path)
|
|
|
|
for file in os.listdir(path):
|
|
device_id = file.split('_')[0]
|
|
if device_id in devices:
|
|
del devices[device_id]
|
|
device_id = file.split('.')[0]
|
|
if device_id in devices:
|
|
del devices[device_id]
|
|
|
|
|
|
if len(devices) > 0:
|
|
print('lost photo: ', len(devices))
|
|
for device_id in devices:
|
|
print(device_id)
|
|
else:
|
|
print('all photos found') |