<< | Index | >>
suspend
suspend
Local Test
# Schedule to run every Tuesday at 06:00 in /etc/crontab: # 0 4 * * 3 ywesee /var/ebps/bin/oddb_kindle --- smtp_server: xxxx smtp_user: xxxx@ywesee.com smtp_pass: 'xxxx' report_to: - mhatakeyama@ywesee.com # - zdavatz@ywesee.com author: med-drugs.ch #source: /var/ebps/data/yaml/fachinfos.ch.oddb.yaml #source: /home/masa/ywesee/ebps/data/yaml/fachinfo.ch.oddb.yaml source: /home/masa/ywesee/ebps/data/yaml/fachinfos.ch.oddb_for_test.yaml #target: /var/ebps/data/books/meddrugs_de_ch_kindle.mobi target: /home/masa/ywesee/ebps/data/books/meddrugs_de_ch_kindle.mobi #cover: /var/ebps/data/covers/startseite_MEDDRUGS_CH.jpg cover: /home/masa/ywesee/ebps/data/covers/startseite_MEDDRUGS_CH.jpg import_from: fachinfo_yaml export_to: mobi_pocket html_index: true image_prefix: /var/www/oddb.org/doc/ image_suffix: .png language: de max_depth: 1 #stylesheet: /var/ebps/data/css/oddb.css stylesheet: /home/masa/ywesee/ebps/data/css/oddb.css #title: Schweizer Medikamenten-Enzyklopädie title: 20111110 Test meddrugs kindle #appendix: /var/ebps/data/covers/endseite_MEDDRUGS_CH.jpg appendix: /home/masa/ywesee/ebps/data/covers/endseite_MEDDRUGS_CH.jpg xml_indent: 0 kindle_quirks: true #postprocess: # copy: # targets: # - ftp://med-drugs:bx4Skp2a@just-medical.com/meddrugs_de_ch_kindle.mobi decorate: - - /home/masa/ywesee/ebps/bin/decorators/just_medical_de.rb - JustMedical # - - /var/ebps/bin/decorators/just_medical_de.rb
Run
masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/meddrugs.ch_de_kindle config="etc/meddrugs.ch_de_kindle.yml"
Note
NoMethodError: undefined method `each_document' for Psych:Module /home/masa/ywesee/ebps/lib/ebps/conversion/fachinfo_yaml.rb:89:in `import' bin/meddrugs.ch_de_kindle:58:in `<main>'
Experiment (kindle v1.2)
kindlegen_path: kindlegen_v1.2 kindlegen_args: -c2 postprocess: - - system_call - command_lines: - - '/home/masa/ywesee/ebps/data/books/' - 'python /home/masa/bin/kindlestrip.py meddrugs_de_ch_kindle_v1.2.mobi meddrugs_de_ch_kindle_v1.2.strip.mobi'
Result
Updates
# encoding: utf-8 module EBPS module Decorator module JustMedical def self.decorate model if codes = model.metadata['article_codes'] size_ean13s = codes.collect do |hash| [hash[:article_size], hash[:article_dose], hash[:article_ean13]] end.compact unless size_ean13s.empty? chapter = Text::Chapter.new chapter.heading << 'Stammdaten' size_ean13s.each do |size, dose, ean13| reg = ean13[4,5] href = "http://just-medical.oddb.org/de/just-medical/show/reg/#{reg}" chapter.add_paragraph Text::LinkedParagraph.new(href, model.title + " " + size.to_s + " " + dose.to_s) end model.add_chapter chapter end end end end end end
# encoding: utf-8 module EBPS module Decorator module JustMedical def self.decorate model if codes = model.metadata['article_codes'] size_ean13s = codes.collect do |hash| [hash[:article_size], hash[:article_dose], hash[:article_ean13]] end.compact unless size_ean13s.empty? chapter = Text::Chapter.new chapter.heading << 'Base des données' size_ean13s.each do |size, dose, ean13| reg = ean13[4,5] href = "http://just-medical.oddb.org/fr/just-medical/show/reg/#{reg}" chapter.add_paragraph Text::LinkedParagraph.new(href, model.title + " " + size.to_s + " " + dose.to_s) end model.add_chapter chapter end end end end end end
Commit
Comparison