Changeset 11547 for main/pyfprint/trunk
- Timestamp:
- 27 Mar 2014, 11:17:08 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/pyfprint/trunk/enroll-script.py
r11540 r11547 28 28 return os.path.join(path, name) 29 29 30 31 def get_stud_id(): 32 """Get a student id via input from keyboard. 33 34 We require the id two times (for safety). The id must not be 35 empty. 36 """ 37 while True: 38 stud_id = raw_input("Please ENTER the STUDENT ID: ") 39 ctrl_id = raw_input("Please repeat : ") 40 if not stud_id: 41 print "Please enter a valid student ID!" 42 stud_id = None 43 if stud_id != ctrl_id: 44 print "IDs do not match. We restart." 45 if stud_id and stud_id == ctrl_id: 46 return stud_id 47 48 30 49 # create results dir if it does not exist already. 31 50 if not os.path.exists(RESULTS_DIR): … … 33 52 os.mkdir(RESULTS_DIR) 34 53 35 print "Hello Issoufou!"36 54 print 37 print "After pressing a key, the fingerprint scanner GUI will"38 print "appear. Then, please do a scan of a finger via the GUI."55 print "After entering a student ID, the fingerprint scanner GUI will" 56 print "appear. Then, please do a scan ('enroll') of a finger via the GUI." 39 57 print 40 58 print "After scanning, please close the scanner programme." … … 44 62 shutil.rmtree(PRINTS_DIR) 45 63 46 stud_id = raw_input("Please ENTER the STUDENT ID: ")64 stud_id = get_stud_id() 47 65 48 66 os.system(CMD) … … 62 80 63 81 print "COPYING fingerprint over..." 82 if os.path.isfile(fp_target): 83 # such a fingerprint exists already (same finger, stud_id) 84 os.unlink(fp_target) 64 85 shutil.copy2(fp_file, fp_target) 65 86
Note: See TracChangeset for help on using the changeset viewer.