Changeset 7969:4045601acb04 in orange


Ignore:
Timestamp:
06/02/11 13:17:13 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
6d1957a30ee17ca6d2667e2061db7a91ecc24064
Message:

Read / write NetworkX network from Python pickle (.gpickle).

Location:
orange/OrangeWidgets/Unsupervised
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Unsupervised/OWNxExplorer.py

    r7967 r7969  
    277277         
    278278        OWGUI.button(ib, self, "Degree distribution", callback=self.showDegreeDistribution, debuggingEnabled=False) 
    279         OWGUI.button(ib, self, "Save network", callback=self.saveNetwork, debuggingEnabled=False) 
     279        OWGUI.button(ib, self, "Save network", callback=self.save_network, debuggingEnabled=False) 
    280280        OWGUI.button(ib, self, "Save image", callback=self.networkCanvas.saveToFile, debuggingEnabled=False) 
    281281         
     
    10761076        print "replot in " + str(stop - start) 
    10771077         
    1078     def saveNetwork(self): 
     1078    def save_network(self): 
    10791079        if self.networkCanvas is None or self.graph is None: 
    10801080            return 
    10811081         
    1082         filename = QFileDialog.getSaveFileName(self, 'Save Network File', '', 'PAJEK network (*.net)\nGML network (*.gml)') 
     1082        filename = QFileDialog.getSaveFileName(self, 'Save Network File', '', 'NetworkX graph as Python pickle (*.gpickle)\nPajek network (*.net)\nGML network (*.gml)') 
    10831083        if filename: 
    10841084            fn = "" 
  • orange/OrangeWidgets/Unsupervised/OWNxFile.py

    r7967 r7969  
    188188         
    189189        fileExt = lower(os.path.splitext(fn)[1]) 
    190         if not fileExt in (".net", ".gml"): 
     190        if not fileExt in (".net", ".gml", ".gpickle"): 
    191191            self.readingFailed(infob='Network file type not supported') 
    192192            return 
     
    380380                startfile = self.recentFiles[0] 
    381381                 
    382         filename = str(QFileDialog.getOpenFileName(self, 'Open a Network File', startfile, "Pajek files (*.net)\nGML files (*.gml)\nAll files (*.*)")) 
     382        filename = str(QFileDialog.getOpenFileName(self, 'Open a Network File', startfile, "NetworkX graph as Python pickle (*.gpickle)\nPajek files (*.net)\nGML files (*.gml)\nAll files (*.*)")) 
    383383         
    384384        if filename == "": return 
Note: See TracChangeset for help on using the changeset viewer.