You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
791 B
37 lines
791 B
#!/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') |