Commits

Marko Toplak  committed d3a65a7

Fixes supporting the move of (most of) Orange.misc to Orange.utils.

  • Participants
  • Parent commits 60f301f

Comments (0)

Files changed (11)

File obiGeneAtlas.py

 import os, sys
 from collections import defaultdict, namedtuple
 
-from Orange.misc import serverfiles
+from Orange.utils import serverfiles
 
 GeneResults = namedtuple("GeneResults", "id name synonyms expressions")
 ExpressionResults = namedtuple("ExpressionResults", "ef efv up down experiments")
     matcher.set_targets(obiGene.EnsembleGeneInfo(taxid).keys())
     return matcher
 
-from Orange.misc import lru_cache
+from Orange.utils import lru_cache
 
 @lru_cache(maxsize=3)
 def _cached_default_gene_matcher(organism): 
     doctest.testmod(optionflags=doctest.ELLIPSIS)
     
 if __name__ == "__main__":
-    test()
+    test()

File obiGeneMania.py

         dst_obj = open(os.path.join(directory, basename), "wb")
     
     if progress == True:
-        from Orange.misc import ConsoleProgressBar
+        from Orange.utils import ConsoleProgressBar
         progress = ConsoleProgressBar("Downloading %r." % basename)
         with finishing(progress):
             copyfileobj(stream, dst_obj, buffer=2**10, content_len=length,
 import obiTaxonomy
 from collections import namedtuple
 from operator import itemgetter
-from Orange.misc import lru_cache
+from Orange.utils import lru_cache
 
 GENE_MANIA_INTERACTION_FIELDS = \
     ["gene_a", "gene_b", "weight", "network_name",

File obiGeneSetSig.py

 import Orange
-import Orange.misc
+import Orange.utils
 import obiGeneSets
 import obiGene
 import numpy
 
 class GeneSetTrans(object):
 
-    __new__ = Orange.misc._orange__new__(object)
+    __new__ = Orange.utils._orange__new__(object)
 
     def _mat_ni(self, data):
         """ With cached gene matchers. """

File obiKEGG2/__init__.py

 
 from datetime import datetime
 
-from Orange.misc import lru_cache, serverfiles
+from Orange.utils import lru_cache, serverfiles
 
 from . import databases
 from . import entry
 
 
 import obiProb
-from Orange.misc import deprecated_keywords, deprecated_attribute
+from Orange.utils import deprecated_keywords, deprecated_attribute
 
 class Organism(object):
     def __init__(self, org, genematcher=None):
     pass
 
 import obiGene
-from Orange.misc import serverfiles
-from Orange.misc import ConsoleProgressBar
+from Orange.utils import ConsoleProgressBar
 
 class MatcherAliasesKEGG(obiGene.MatcherAliasesPickled):
     DOMAIN = "KEGG"
     doctest.testmod(optionflags=doctest.ELLIPSIS, extraglobs=extraglobs)
 
 if __name__ == "__main__":
-    sys.exit(main())
+    sys.exit(main())

File obiKEGG2/api.py

 except ImportError:
     # TODO: move a copy of lru_cache in .caching if distributing this as a
     # standalone package
-    from Orange.misc import lru_cache
+    from Orange.utils import lru_cache
 
     
 class CachedKeggApi(KeggApi):
     @cached_method
     def get_kos_by_pathway(self, pathway_id):
         return KeggApi.get_kos_by_pathway(self, pathway_id)
-    
+    

File obiKEGG2/brite.py

 import re
 import urllib2
 
-from Orange.misc import deprecated_attribute
+from Orange.utils import deprecated_attribute
 
 from . import conf
 class BriteEntry(object):
                 else:
                     lines.pop(0)
                         
-        collect([line for line in lines if not line.startswith("#") and len(line) > 1], "A", self.entries)
+        collect([line for line in lines if not line.startswith("#") and len(line) > 1], "A", self.entries)

File obiKEGG2/conf.py

 import os
 import ConfigParser
 from StringIO import StringIO
-from Orange.misc import serverfiles
+from Orange.utils import serverfiles
 kegg_dir = serverfiles.localpath("KEGG2")
 
 default = """

File obiKEGG2/pathway.py

 from . import conf
 from . import caching
 
-from Orange.misc import deprecated_attribute
+from Orange.utils import deprecated_attribute
     
 def cached_method(func, cache_name="_cached_method_cache", store=None):
     def wrapper(self, *args, **kwargs):
         from . import api 
         kegg = api.CachedKeggApi()
         return kegg.list_pathways(organism)
-    
+    
 import obiTaxonomy
 from obiTaxonomy import pickled_cache
 
-from Orange.misc import lru_cache, ConsoleProgressBar
+from Orange.utils import lru_cache
+from Orange.utils import ConsoleProgressBar
 
 import sqlite3
 import urllib2
     for protein in mips_proteins():
         print "Protein", protein, "interacts with", 
         print ",".join(set(reduce(list.__add__, [[inter.protein1, inter.protein2] for inter in mips_interactions(protein)], [])) -set([protein]))
-            
+            

File widgets/OWGEODatasets.py

     def setHeaderData(self, section, orientation, value, role=Qt.EditRole):
         self._header[orientation][section][role] = value
         
-from Orange.misc import lru_cache
+from Orange.utils import lru_cache
 
 class MySortFilterProxyModel(QSortFilterProxyModel):    
     def __init__(self, parent=None):

File widgets/prototypes/OWGeneAtlasTissueExpression.py

 from OWWidget import *
 
 from collections import defaultdict
-from Orange.misc import lru_cache
+from Orange.utils import lru_cache
 
 import orngDataCaching
 import orngServerFiles