lib/bio/shell/plugin/entry.rb in bio-1.4.1 vs lib/bio/shell/plugin/entry.rb in bio-1.4.2

- old
+ new

@@ -60,11 +60,11 @@ # * IO -- IO object (first entry only) # * "filename" -- local file (first entry only) # * "db:entry" -- local BioFlat, OBDA, EMBOSS, KEGG API def getent(arg) entry = "" - db, entry_id = arg.to_s.strip.split(/:/) + db, entry_id = arg.to_s.strip.split(/\:/, 2) # local file if arg.respond_to?(:gets) or File.exists?(arg) puts "Retrieving entry from file (#{arg})" entry = flatfile(arg) @@ -79,11 +79,15 @@ puts "Retrieving entry from OBDA (#{arg})" entry = obdaentry(db, entry_id) else # EMBOSS USA in ~/.embossrc - str = entret(arg) - if $?.exitstatus == 0 and str.length != 0 + begin + str = entret(arg) + rescue SystemCallError + str = '' + end + if $? and $?.exitstatus == 0 and str.length != 0 puts "Retrieving entry from EMBOSS (#{arg})" entry = str # via Internet else