Commits

Miha Stajdohar committed 65e1b14

Comments (0)

Files changed (1)

orange/OrangeWidgets/Unsupervised/OWDistanceFile.py

         self.error()
         
         try:
+            self.matrix = None
+            self.labels = None
+            self.data = None
             self.matrix, self.labels, self.data = readMatrix(fn)
             self.relabel()
         except:
                 else:
                     self.error("The number of examples doesn't match the matrix dimension")
         else:
-            matrix.setattr("items", self.labels)
-            
+            lbl = orange.StringVariable('label')
+            self.data = orange.ExampleTable(orange.Domain([lbl]), 
+                                            [[str(l)] for l in self.labels])
+            omatrix.setattr("items", self.data)
 
         if self.data == None and self.labels == None:
             matrix.setattr("items", range(matrix.dim))