Index: /main/pyfprint/trunk/enroll-script.py
===================================================================
--- /main/pyfprint/trunk/enroll-script.py	(revision 11546)
+++ /main/pyfprint/trunk/enroll-script.py	(revision 11547)
@@ -28,4 +28,23 @@
     return os.path.join(path, name)
 
+
+def get_stud_id():
+    """Get a student id via input from keyboard.
+
+    We require the id two times (for safety). The id must not be
+    empty.
+    """
+    while True:
+        stud_id = raw_input("Please ENTER the STUDENT ID: ")
+        ctrl_id = raw_input("Please repeat              : ")
+        if not stud_id:
+            print "Please enter a valid student ID!"
+            stud_id = None
+        if stud_id != ctrl_id:
+            print "IDs do not match. We restart."
+        if stud_id and stud_id == ctrl_id:
+            return stud_id
+
+
 # create results dir if it does not exist already.
 if not os.path.exists(RESULTS_DIR):
@@ -33,8 +52,7 @@
     os.mkdir(RESULTS_DIR)
 
-print "Hello Issoufou!"
 print
-print "After pressing a key, the fingerprint scanner GUI will"
-print "appear. Then, please do a scan of a finger via the GUI."
+print "After entering a student ID, the fingerprint scanner GUI will"
+print "appear. Then, please do a scan ('enroll') of a finger via the GUI."
 print
 print "After scanning, please close the scanner programme."
@@ -44,5 +62,5 @@
     shutil.rmtree(PRINTS_DIR)
 
-stud_id = raw_input("Please ENTER the STUDENT ID: ")
+stud_id = get_stud_id()
 
 os.system(CMD)
@@ -62,4 +80,7 @@
 
 print "COPYING fingerprint over..."
+if os.path.isfile(fp_target):
+    # such a fingerprint exists already (same finger, stud_id)
+    os.unlink(fp_target)
 shutil.copy2(fp_file, fp_target)
 
