view · edit · sidebar · attach · print · history

20120116-fix-rss-pointer-link-new-patent-link-encode-compress-oddb_csv-fix-download-patinfo-invoices-update-sbsm-simple_uri_parser

<< Masa.20120117-update-sbsm-update-narcotics-data-importer-fix-small-bugs-oddb_org | Index | Masa.20120113-fix-migel-link-errros-update-oddb2tdat-check-sbsm-rockit >>


  1. Fix Download invoice error
  2. Fix Patinfo invoice error
  3. Fix Rss pointer link
  4. Add encoded and compressed oddb.csv to a report mail
  5. Replace SBSM Rockit

Commits

Fix Download invoice error

Error (mail_download_invoices)

Error: TypeError
Message: can't iterate from Time
Backtrace:
/var/www/oddb.org/src/plugin/download_invoicer.rb:63:in `each'
/var/www/oddb.org/src/plugin/download_invoicer.rb:63:in `include?'
/var/www/oddb.org/src/plugin/download_invoicer.rb:63:in `include?'
/var/www/oddb.org/src/plugin/download_invoicer.rb:63:in `block in recent_items'

Commit

Fix Patinfo invoice error

Error (mail_patinfo_invoices)

Error: ArgumentError
Message: invalid byte sequence in UTF-8
Backtrace:
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.3.0/lib/mail/core_extensions/string.rb:12:in `=~'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.3.0/lib/mail/core_extensions/string.rb:12:in `!~'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.3.0/lib/mail/core_extensions/string.rb:12:in `blank?'
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.3.0/lib/mail/body.rb:36:in `initialize'

Temporary solution

  • /usr/local/lib/ruby/gems/1.9.1/gems/mail-2.3.0/lib/mail/core_extensions/string.rb
 def blank?
    self !~ /\S/
   rescue
     self.force_encoding("UTF-8")
     self.encode!("UTF-16BE", :invalid => :replace, :undef => :replace, :replace => '?')
     self.encode!("UTF-8")
     self !~ /\S/
 end

Note

  • Let's see the next result

Fix Rss pointer link

Error (update_textinfo_news)

Plugin: ODDB::TextInfoPlugin
Error: NoMethodError
Message: undefined method `to_html' for nil:NilClass
Backtrace:
/home/masa/ywesee/oddb.org/src/plugin/text_info.rb:107:in `fachinfo_news'
/home/masa/ywesee/oddb.org/src/plugin/text_info.rb:159:in `import_news'
/home/masa/ywesee/oddb.org/src/util/updater.rb:409:in `block in update_notify_simple'
/home/masa/ywesee/oddb.org/src/util/updater.rb:389:in `call'

Commit

Add encoded and compressed oddb.csv to a report mail

Current status

  • oddb.csv is outputted with UTF-8
  • It is compressed with gzip and zip
  • oddb.csv is encoded into ISO-8859-1 when a report mail is sent without compression

Goal

  • compressed oddb.csv should be attached to a report mail

Algorithm

  • encoding oddb.csv when it is exported (using @options[:iconv])
  • attaching a compressed file to a report mail (using @options[:compression])

Commit

Note (for future development)

  • @options[:iconv] is used usually when a mail is sent (Log#notify) in order to convert the encoding of attached file
  • But only CsvPlugin#export_drugs (export_drugs_extended) uses the @options[:iconv] when the csv file is exported (in View::Drugs::CsvResult#to_csv_file)
  • Originally /var/www/oddb.org/data/downloads/oddb.csv is encoded in UTF-8 even if @options[:iconv] is set, but this update changes the original file encoding with ISO-8859-1 (@options[:iconv])

Replace SBSM Rockit

Refer

Commit

Note

  • If rockit library is installed then rockit parser is used
  • If rockit library is NOT installed then simple_parse_uri method is used.
view · edit · sidebar · attach · print · history
Page last modified on January 16, 2012, at 05:09 PM