Changeset 1538:1241665d4e60 in orange-bioinformatics for obiKEGG2/databases.py


Ignore:
Timestamp:
02/02/12 13:11:50 (2 years ago)
Author:
ales_erjavec
Branch:
default
Message:

Fixing errors in get and batch_get.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • obiKEGG2/databases.py

    r1536 r1538  
    7777     
    7878    def get(self, key, default=None): 
    79         if key in self: 
     79        try: 
    8080            return self.__getitem__(key) 
    81         else: 
     81        except KeyError: 
    8282            return default 
    8383         
     
    162162                batch_entries = batch_entries.split("///\n") 
    163163                # Remove possible empty last line   
    164                 batch_entries = [e for e in batch_entries if e.strip()]  
     164                batch_entries = [e for e in batch_entries if e.strip()] 
    165165                entries.extend(map(self.ENTRY_TYPE, batch_entries)) 
    166166            start += batch_size 
Note: See TracChangeset for help on using the changeset viewer.