Flashpoint avatar Flashpoint committed 3ca19c9

Fixed a filename bug in OWCustomSets.py

Comments (0)

Files changed (1)

_bioinformatics/widgets/OWCustomSets.py

 """
 <name>Custom Gene Sets</name>
 <description>Manage custom geneset files</description>
-<icon></icon>
+<icon>icons/customSets.svg</icon>
 <contact>Vid Jelen (vid.jelen1@gmail.com)</contact>
 """
 import os
     def selection(self): 
         if self.listView.selectedItems():
             self.info.clear()
-            name = self.listView.selectedItems()[0].text(0)            
+            name = self.listView.selectedItems()[0].text(0).replace(" - ", "_._") 
             for geneset in os.listdir(local_path()):
                 if geneset.__contains__(str(name)):
                     the_file = os.path.join(local_path(), geneset) 
         self.listView.clear()
         for geneset in os.listdir(local_path()):
             item = QTreeWidgetItem(self.listView)
-            name = geneset[geneset.index("_._")+3:geneset.index(".gmt")+4]
+            name = geneset[geneset.index("_")+1:geneset.rfind("_._")]
             the_file = os.path.join(local_path(), geneset)
             mod_time = str(modification_date(the_file))
-            item.setText(0, name)
+            item.setText(0, name.replace("_._", " - "))
             item.setText(1, mod_time[:mod_time.rfind(".")])
 
     def on_select_recent(self, recent):
         if self.listView.selectedItems():
             final_text = ""
             self.preview_view.clear()
-            name = self.listView.selectedItems()[0].text(0)            
+            name = self.listView.selectedItems()[0].text(0).replace(" - ", "_._")            
             for geneset in os.listdir(local_path()):
                 if geneset.__contains__(str(name)):
                     the_file = os.path.join(local_path(), geneset) 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.