Commits

Aleš Erjavec committed 6481dba

get_entries_by_type returns a list, renamed cache filename.

Comments (0)

Files changed (1)

obiKEGG2/pathway.py

 from . import caching
 
 from Orange.misc import deprecated_attribute
-
     
 def cached_method(func, cache_name="_cached_method_cache", store=None):
     def wrapper(self, *args, **kwargs):
         import shelve
         caching.touch_dir(self.local_cache)
         return caching.Sqlite3Store(os.path.join(self.local_cache,
-                                                 "last-modified.sqlite3"))
+                                                 "last_modified.sqlite3"))
         
     def _get_kgml(self):
         """ Return an open kgml file for the pathway.
         return reduce(list.__add__, [self.genes(), self.compounds(), self.enzmes(), self.reactions()], [])
     
     def _get_entries_by_type(self, type):
-        return reduce(set.union, [entry.name.split() for entry in self.entries() if entry.type == type], set())
+        return sorted(reduce(set.union, [entry.name.split() for entry in self.entries() if entry.type == type], set()))
     
     @cached_method
     def genes(self):