Commits

TK Soh  committed 7af4448

hggtk/datamine: warn if attempt to annotate directories

  • Participants
  • Parent commits ca89e13

Comments (0)

Files changed (1)

File hggtk/datamine.py

         'include':[], 'exclude':[]
     }
 
-    cfiles = [util.canonpath(root, cwd, f) for f in files if os.path.isfile(f)]
-
     dialog = DataMineDialog(u, repo, cwd, files, cmdoptions, True)
     dialog.display()
-    for f in cfiles:
-        dialog.add_annotate_page(f, '.')
+    for f in files:
+        if os.path.isfile(f):
+            cf = util.canonpath(root, cwd, f) 
+            dialog.add_annotate_page(cf, '.')
+        elif os.path.isdir(f):
+            Prompt('Invalid path', "Can't annotate directory: %s" % f,
+                    dialog).run()
+                    
     if not dialog.notebook.get_n_pages():
         dialog.add_search_page()