From 251b6720cac31cc62b1e09544c317757fd274ef4 Mon Sep 17 00:00:00 2001 From: "pap(openerp)" <> Date: Tue, 20 Oct 2009 16:22:23 +0530 Subject: [PATCH] Changed encoding to coding ref: PEP: 0263 bzr revid: hda@tinyerp.com-20091020105223-2o94yr2iv2v10axr --- bin/__init__.py | 2 +- bin/addons/__init__.py | 2 +- bin/addons/base/__init__.py | 2 +- bin/addons/base/__terp__.py | 2 +- bin/addons/base/ir/__init__.py | 2 +- bin/addons/base/ir/ir_actions.py | 2 +- bin/addons/base/ir/ir_attachment.py | 2 +- bin/addons/base/ir/ir_board.py | 2 +- bin/addons/base/ir/ir_cron.py | 2 +- bin/addons/base/ir/ir_default.py | 2 +- bin/addons/base/ir/ir_exports.py | 2 +- bin/addons/base/ir/ir_fields_description.py | 2 +- bin/addons/base/ir/ir_model.py | 2 +- bin/addons/base/ir/ir_report_custom.py | 2 +- bin/addons/base/ir/ir_rule.py | 2 +- bin/addons/base/ir/ir_sequence.py | 2 +- bin/addons/base/ir/ir_translation.py | 2 +- bin/addons/base/ir/ir_ui_menu.py | 2 +- bin/addons/base/ir/ir_ui_view.py | 2 +- bin/addons/base/ir/ir_values.py | 2 +- bin/addons/base/ir/wizard/__init__.py | 2 +- bin/addons/base/ir/wizard/create_action.py | 2 +- bin/addons/base/ir/wizard/wizard_menu.py | 2 +- bin/addons/base/ir/workflow/__init__.py | 2 +- bin/addons/base/ir/workflow/print_instance.py | 2 +- bin/addons/base/ir/workflow/workflow.py | 2 +- bin/addons/base/maintenance/__init__.py | 2 +- bin/addons/base/maintenance/maintenance.py | 2 +- bin/addons/base/module/__init__.py | 2 +- bin/addons/base/module/module.py | 2 +- bin/addons/base/module/report/__init__.py | 2 +- .../report/ir_module_reference_print.py | 2 +- bin/addons/base/module/wizard/__init__.py | 2 +- bin/addons/base/module/wizard/add_new.py | 2 +- .../base/module/wizard/wizard_export_lang.py | 2 +- .../base/module/wizard/wizard_import_lang.py | 2 +- .../module/wizard/wizard_module_import.py | 2 +- .../wizard/wizard_module_lang_install.py | 2 +- .../module/wizard/wizard_module_upgrade.py | 2 +- .../module/wizard/wizard_update_module.py | 2 +- .../wizard/wizard_update_translations.py | 2 +- bin/addons/base/res/__init__.py | 2 +- bin/addons/base/res/bank.py | 2 +- bin/addons/base/res/country.py | 2 +- bin/addons/base/res/ir_property.py | 2 +- bin/addons/base/res/partner/__init__.py | 2 +- bin/addons/base/res/partner/crm.py | 2 +- bin/addons/base/res/partner/partner.py | 2 +- .../base/res/partner/report/__init__.py | 2 +- .../base/res/partner/wizard/__init__.py | 2 +- .../res/partner/wizard/wizard_clear_ids.py | 2 +- .../res/partner/wizard/wizard_ean_check.py | 2 +- .../base/res/partner/wizard/wizard_sms.py | 2 +- .../base/res/partner/wizard/wizard_spam.py | 2 +- bin/addons/base/res/res_company.py | 2 +- bin/addons/base/res/res_currency.py | 2 +- bin/addons/base/res/res_lang.py | 2 +- bin/addons/base/res/res_request.py | 2 +- bin/addons/base/res/res_user.py | 2 +- bin/addons/module_graph.py | 2 +- .../base_quality_interrogation.py | 2 +- bin/ir/__init__.py | 2 +- bin/ir/ir.py | 2 +- bin/mako/__init__.py | 1 + bin/mako/ast.py | 1 + bin/mako/cache.py | 1 + bin/mako/codegen.py | 1 + bin/mako/exceptions.py | 1 + bin/mako/ext/__init__.py | 21 + bin/mako/ext/autohandler.py | 1 + bin/mako/ext/babelplugin.py | 1 + bin/mako/ext/preprocessors.py | 1 + bin/mako/ext/pygmentplugin.py | 1 + bin/mako/ext/turbogears.py | 1 + bin/mako/filters.py | 1 + bin/mako/lexer.py | 1 + bin/mako/lookup.py | 1 + bin/mako/parsetree.py | 1 + bin/mako/pygen.py | 1 + bin/mako/pyparser.py | 1 + bin/mako/runtime.py | 1 + bin/mako/template.py | 1 + bin/mako/util.py | 1 + bin/netsvc.py | 2 +- bin/openerp-server.py | 2 +- bin/osv/__init__.py | 2 +- bin/osv/expression.py | 4 +- bin/osv/fields.py | 2 +- bin/osv/orm.py | 4 +- bin/osv/osv.py | 2 +- bin/pooler.py | 2 +- bin/pychart/__init__.py | 2 +- bin/pychart/afm/AvantGarde_Book.py | 1 + bin/pychart/afm/AvantGarde_BookOblique.py | 1 + bin/pychart/afm/AvantGarde_Demi.py | 1 + bin/pychart/afm/AvantGarde_DemiOblique.py | 1 + bin/pychart/afm/Bookman_Demi.py | 1 + bin/pychart/afm/Bookman_DemiItalic.py | 1 + bin/pychart/afm/Bookman_Light.py | 1 + bin/pychart/afm/Bookman_LightItalic.py | 1 + bin/pychart/afm/Courier.py | 1 + bin/pychart/afm/Courier_Bold.py | 1 + bin/pychart/afm/Courier_BoldOblique.py | 1 + bin/pychart/afm/Courier_Oblique.py | 1 + bin/pychart/afm/Helvetica.py | 1 + bin/pychart/afm/Helvetica_Bold.py | 1 + bin/pychart/afm/Helvetica_BoldOblique.py | 1 + bin/pychart/afm/Helvetica_Light.py | 1 + bin/pychart/afm/Helvetica_LightOblique.py | 1 + bin/pychart/afm/Helvetica_Narrow.py | 1 + bin/pychart/afm/Helvetica_Narrow_Bold.py | 1 + .../afm/Helvetica_Narrow_BoldOblique.py | 1 + bin/pychart/afm/Helvetica_Narrow_Oblique.py | 1 + bin/pychart/afm/Helvetica_Oblique.py | 1 + bin/pychart/afm/NewCenturySchlbk_Bold.py | 1 + .../afm/NewCenturySchlbk_BoldItalic.py | 1 + bin/pychart/afm/NewCenturySchlbk_Italic.py | 1 + bin/pychart/afm/NewCenturySchlbk_Roman.py | 1 + bin/pychart/afm/Palatino_Bold.py | 1 + bin/pychart/afm/Palatino_BoldItalic.py | 1 + bin/pychart/afm/Palatino_Italic.py | 1 + bin/pychart/afm/Palatino_Roman.py | 1 + bin/pychart/afm/Symbol.py | 1 + bin/pychart/afm/Times_Bold.py | 1 + bin/pychart/afm/Times_BoldItalic.py | 1 + bin/pychart/afm/Times_Italic.py | 1 + bin/pychart/afm/Times_Roman.py | 1 + bin/pychart/afm/Utopia_Bold.py | 1 + bin/pychart/afm/Utopia_BoldItalic.py | 1 + bin/pychart/afm/Utopia_Italic.py | 1 + bin/pychart/afm/Utopia_Regular.py | 1 + bin/pychart/afm/ZapfChancery_MediumItalic.py | 1 + bin/pychart/afm/ZapfDingbats.py | 1 + bin/pychart/afm/__init__.py | 2 +- bin/pychart/afm/dir.py | 5 +- bin/pychart/area.py | 1 + bin/pychart/area_doc.py | 1 + bin/pychart/arrow.py | 1 + bin/pychart/arrow_doc.py | 1 + bin/pychart/axis.py | 1 + bin/pychart/axis_doc.py | 1 + bin/pychart/axis_x_doc.py | 1 + bin/pychart/axis_y_doc.py | 1 + bin/pychart/bar_plot.py | 1 + bin/pychart/bar_plot_doc.py | 1 + bin/pychart/basecanvas.py | 1 + bin/pychart/canvas.py | 1 + bin/pychart/category_coord.py | 1 + bin/pychart/chart_data.py | 1 + bin/pychart/chart_object.py | 1 + bin/pychart/color.py | 1 + bin/pychart/color_doc.py | 1 + bin/pychart/coord.py | 1 + bin/pychart/doc_support.py | 1 + bin/pychart/empty_docs.py | 1 + bin/pychart/error_bar.py | 1 + bin/pychart/error_bar_doc.py | 1 + bin/pychart/fill_style.py | 1 + bin/pychart/fill_style_doc.py | 1 + bin/pychart/font.py | 1 + bin/pychart/generate_docs.py | 1 + bin/pychart/gs_frontend.py | 1 + bin/pychart/interval_bar_plot.py | 1 + bin/pychart/legend.py | 1 + bin/pychart/legend_doc.py | 1 + bin/pychart/line_plot.py | 1 + bin/pychart/line_plot_doc.py | 1 + bin/pychart/line_style.py | 1 + bin/pychart/line_style_doc.py | 1 + bin/pychart/linear_coord.py | 1 + bin/pychart/log_coord.py | 1 + bin/pychart/object_set.py | 1 + bin/pychart/pdfcanvas.py | 1 + bin/pychart/pie_plot.py | 1 + bin/pychart/pie_plot_doc.py | 1 + bin/pychart/pngcanvas.py | 1 + bin/pychart/pscanvas.py | 1 + bin/pychart/pychart_types.py | 115 +-- bin/pychart/pychart_util.py | 1 + bin/pychart/range_plot.py | 1 + bin/pychart/range_plot_doc.py | 1 + bin/pychart/rose_plot.py | 1 + bin/pychart/scaling.py | 1 + bin/pychart/svgcanvas.py | 1 + bin/pychart/text_box.py | 1 + bin/pychart/text_box_doc.py | 1 + bin/pychart/theme.py | 1 + bin/pychart/tick_mark.py | 1 + bin/pychart/tick_mark_doc.py | 1 + bin/pychart/typechecker.py | 1 + bin/pychart/version.py | 1 + bin/pychart/x11canvas.py | 1 + bin/pychart/zap.py | 1 + bin/release.py | 2 +- bin/report/__init__.py | 2 +- bin/report/common.py | 2 +- bin/report/custom.py | 2 +- bin/report/int_to_text.py | 2 +- bin/report/interface.py | 2 +- bin/report/misc.py | 2 +- bin/report/preprocess.py | 2 +- bin/report/print_fnc.py | 2 +- bin/report/print_xml.py | 2 +- bin/report/printscreen/__init__.py | 2 +- bin/report/printscreen/ps_form.py | 2 +- bin/report/printscreen/ps_list.py | 2 +- bin/report/pyPdf/__init__.py | 1 + bin/report/pyPdf/filters.py | 505 ++++++------- bin/report/pyPdf/generic.py | 1 + bin/report/pyPdf/pdf.py | 1 + bin/report/pyPdf/utils.py | 221 +++--- bin/report/pyPdf/xmp.py | 711 +++++++++--------- bin/report/render/__init__.py | 2 +- bin/report/render/html2html/__init__.py | 2 +- bin/report/render/html2html/html2html.py | 2 +- bin/report/render/odt2odt/__init__.py | 2 +- bin/report/render/odt2odt/odt2odt.py | 2 +- bin/report/render/render.py | 2 +- bin/report/render/rml.py | 2 +- bin/report/render/rml2html/__init__.py | 2 +- bin/report/render/rml2html/rml2html.py | 2 +- bin/report/render/rml2html/utils.py | 2 +- bin/report/render/rml2pdf/__init__.py | 2 +- bin/report/render/rml2pdf/color.py | 2 +- bin/report/render/rml2pdf/trml2pdf.py | 2 +- bin/report/render/rml2pdf/utils.py | 2 +- bin/report/render/simple.py | 2 +- bin/report/report_sxw.py | 2 +- bin/service/__init__.py | 2 +- bin/service/security.py | 2 +- bin/service/web_services.py | 2 +- bin/sql_db.py | 2 +- bin/tiny_socket.py | 2 +- bin/tools/__init__.py | 2 +- bin/tools/amount_to_text.py | 2 +- bin/tools/amount_to_text_en.py | 2 +- bin/tools/config.py | 2 +- bin/tools/convert.py | 2 +- bin/tools/copy.py | 2 +- bin/tools/func.py | 2 +- bin/tools/graph.py | 2 +- bin/tools/import_email.py | 2 +- bin/tools/maintenance.py | 2 +- bin/tools/misc.py | 2 +- bin/tools/osutil.py | 2 +- bin/tools/parse_version.py | 2 +- bin/tools/pdf_utils.py | 2 +- bin/tools/sql.py | 2 +- bin/tools/threadinglocal.py | 2 +- bin/tools/translate.py | 2 +- bin/tools/win32.py | 2 +- bin/wizard/__init__.py | 2 +- bin/workflow/__init__.py | 2 +- bin/workflow/common.py | 2 +- bin/workflow/instance.py | 2 +- bin/workflow/wkf_expr.py | 2 +- bin/workflow/wkf_logs.py | 2 +- bin/workflow/wkf_service.py | 2 +- bin/workflow/workitem.py | 2 +- doc/migrate/3.3.0-3.4.0/post.py | 2 +- doc/migrate/3.3.0-3.4.0/pre.py | 2 +- doc/migrate/3.4.0-4.0.0/post-tiny.py | 2 +- doc/migrate/3.4.0-4.0.0/post.py | 2 +- doc/migrate/3.4.0-4.0.0/pre-tiny.py | 2 +- doc/migrate/3.4.0-4.0.0/pre.py | 2 +- doc/migrate/4.0.0-4.2.0/pre.py | 2 +- doc/migrate/4.0.0-4.2.0/tiny/pre-tiny.py | 2 +- doc/migrate/4.2.0-4.4.0/pre.py | 2 +- doc/tests/check_profile_l10n_all.py | 2 +- setup.py | 2 +- win32/OpenERPServerService.py | 2 +- win32/setup.py | 2 +- 272 files changed, 1070 insertions(+), 924 deletions(-) diff --git a/bin/__init__.py b/bin/__init__.py index cbf54637905..e2c8cd49cc2 100644 --- a/bin/__init__.py +++ b/bin/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index a9362160772..025b2a7b772 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/__init__.py b/bin/addons/base/__init__.py index 02a49ff7417..bf315934c6d 100644 --- a/bin/addons/base/__init__.py +++ b/bin/addons/base/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/__terp__.py b/bin/addons/base/__terp__.py index e4db55640f1..186271d8611 100644 --- a/bin/addons/base/__terp__.py +++ b/bin/addons/base/__terp__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/__init__.py b/bin/addons/base/ir/__init__.py index b6d8f3e013f..a3f3e7e16c4 100644 --- a/bin/addons/base/ir/__init__.py +++ b/bin/addons/base/ir/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_actions.py b/bin/addons/base/ir/ir_actions.py index 06c7b44753a..f37f8d2945d 100644 --- a/bin/addons/base/ir/ir_actions.py +++ b/bin/addons/base/ir/ir_actions.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_attachment.py b/bin/addons/base/ir/ir_attachment.py index 4737054e8f4..4a41cc6c510 100644 --- a/bin/addons/base/ir/ir_attachment.py +++ b/bin/addons/base/ir/ir_attachment.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_board.py b/bin/addons/base/ir/ir_board.py index 5c1f2875c71..f7d3edd5cce 100644 --- a/bin/addons/base/ir/ir_board.py +++ b/bin/addons/base/ir/ir_board.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_cron.py b/bin/addons/base/ir/ir_cron.py index 0ef23a6c423..f86577889e4 100644 --- a/bin/addons/base/ir/ir_cron.py +++ b/bin/addons/base/ir/ir_cron.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_default.py b/bin/addons/base/ir/ir_default.py index 2cbfc939898..d229ee4cb5c 100644 --- a/bin/addons/base/ir/ir_default.py +++ b/bin/addons/base/ir/ir_default.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_exports.py b/bin/addons/base/ir/ir_exports.py index c8bbb276e11..48f4141d0b5 100644 --- a/bin/addons/base/ir/ir_exports.py +++ b/bin/addons/base/ir/ir_exports.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_fields_description.py b/bin/addons/base/ir/ir_fields_description.py index d88db553d42..9a3b5424a58 100644 --- a/bin/addons/base/ir/ir_fields_description.py +++ b/bin/addons/base/ir/ir_fields_description.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_model.py b/bin/addons/base/ir/ir_model.py index 7e82f11c8ee..2f3b188f770 100644 --- a/bin/addons/base/ir/ir_model.py +++ b/bin/addons/base/ir/ir_model.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_report_custom.py b/bin/addons/base/ir/ir_report_custom.py index f72ed63ba6b..3b20d193d8b 100644 --- a/bin/addons/base/ir/ir_report_custom.py +++ b/bin/addons/base/ir/ir_report_custom.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_rule.py b/bin/addons/base/ir/ir_rule.py index a127c781588..293323f04a5 100644 --- a/bin/addons/base/ir/ir_rule.py +++ b/bin/addons/base/ir/ir_rule.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_sequence.py b/bin/addons/base/ir/ir_sequence.py index cf504216977..aa1a498d66b 100644 --- a/bin/addons/base/ir/ir_sequence.py +++ b/bin/addons/base/ir/ir_sequence.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_translation.py b/bin/addons/base/ir/ir_translation.py index c99174c67c6..a03e1005282 100644 --- a/bin/addons/base/ir/ir_translation.py +++ b/bin/addons/base/ir/ir_translation.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_ui_menu.py b/bin/addons/base/ir/ir_ui_menu.py index 19f7092c189..133dc89f6b0 100644 --- a/bin/addons/base/ir/ir_ui_menu.py +++ b/bin/addons/base/ir/ir_ui_menu.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_ui_view.py b/bin/addons/base/ir/ir_ui_view.py index ec4b89394c7..b66d7eedcf6 100644 --- a/bin/addons/base/ir/ir_ui_view.py +++ b/bin/addons/base/ir/ir_ui_view.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/ir_values.py b/bin/addons/base/ir/ir_values.py index 3e408e410c0..64196007fd2 100644 --- a/bin/addons/base/ir/ir_values.py +++ b/bin/addons/base/ir/ir_values.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/wizard/__init__.py b/bin/addons/base/ir/wizard/__init__.py index 1054c02fec2..b1a92b51272 100644 --- a/bin/addons/base/ir/wizard/__init__.py +++ b/bin/addons/base/ir/wizard/__init__.py @@ -1,4 +1,4 @@ - # -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/wizard/create_action.py b/bin/addons/base/ir/wizard/create_action.py index 2b2a129d426..335f7a5ce04 100644 --- a/bin/addons/base/ir/wizard/create_action.py +++ b/bin/addons/base/ir/wizard/create_action.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/wizard/wizard_menu.py b/bin/addons/base/ir/wizard/wizard_menu.py index 19fda711e91..ab48e6071bf 100644 --- a/bin/addons/base/ir/wizard/wizard_menu.py +++ b/bin/addons/base/ir/wizard/wizard_menu.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/workflow/__init__.py b/bin/addons/base/ir/workflow/__init__.py index 972fe215573..daa5bb1d29a 100644 --- a/bin/addons/base/ir/workflow/__init__.py +++ b/bin/addons/base/ir/workflow/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/workflow/print_instance.py b/bin/addons/base/ir/workflow/print_instance.py index 7be547e3c0d..e70be5bebbe 100644 --- a/bin/addons/base/ir/workflow/print_instance.py +++ b/bin/addons/base/ir/workflow/print_instance.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/ir/workflow/workflow.py b/bin/addons/base/ir/workflow/workflow.py index 489e5a670b2..89e18a08fb4 100644 --- a/bin/addons/base/ir/workflow/workflow.py +++ b/bin/addons/base/ir/workflow/workflow.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/maintenance/__init__.py b/bin/addons/base/maintenance/__init__.py index b0796a0eee5..329c61301d9 100644 --- a/bin/addons/base/maintenance/__init__.py +++ b/bin/addons/base/maintenance/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/maintenance/maintenance.py b/bin/addons/base/maintenance/maintenance.py index c30573cf037..389d915512f 100644 --- a/bin/addons/base/maintenance/maintenance.py +++ b/bin/addons/base/maintenance/maintenance.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/__init__.py b/bin/addons/base/module/__init__.py index 614311482fe..b07332b81d4 100644 --- a/bin/addons/base/module/__init__.py +++ b/bin/addons/base/module/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index 54389868b46..ced645fc55d 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/report/__init__.py b/bin/addons/base/module/report/__init__.py index ecc376fac1a..4d58fb00b42 100644 --- a/bin/addons/base/module/report/__init__.py +++ b/bin/addons/base/module/report/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/report/ir_module_reference_print.py b/bin/addons/base/module/report/ir_module_reference_print.py index 1e7f7ee53fb..f5f8550a74c 100644 --- a/bin/addons/base/module/report/ir_module_reference_print.py +++ b/bin/addons/base/module/report/ir_module_reference_print.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/wizard/__init__.py b/bin/addons/base/module/wizard/__init__.py index fb97665ff04..e09ad04b091 100644 --- a/bin/addons/base/module/wizard/__init__.py +++ b/bin/addons/base/module/wizard/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/wizard/add_new.py b/bin/addons/base/module/wizard/add_new.py index f3c0c4bb58c..0e2028e7624 100644 --- a/bin/addons/base/module/wizard/add_new.py +++ b/bin/addons/base/module/wizard/add_new.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/wizard/wizard_export_lang.py b/bin/addons/base/module/wizard/wizard_export_lang.py index 7967bdb5ff7..41ebbca64cb 100644 --- a/bin/addons/base/module/wizard/wizard_export_lang.py +++ b/bin/addons/base/module/wizard/wizard_export_lang.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/wizard/wizard_import_lang.py b/bin/addons/base/module/wizard/wizard_import_lang.py index bb9446c3b6c..70f94a68f98 100644 --- a/bin/addons/base/module/wizard/wizard_import_lang.py +++ b/bin/addons/base/module/wizard/wizard_import_lang.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/wizard/wizard_module_import.py b/bin/addons/base/module/wizard/wizard_module_import.py index 5f58aa2664b..1350a4ad0ba 100644 --- a/bin/addons/base/module/wizard/wizard_module_import.py +++ b/bin/addons/base/module/wizard/wizard_module_import.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/wizard/wizard_module_lang_install.py b/bin/addons/base/module/wizard/wizard_module_lang_install.py index 54cbc6a3c73..7367bdb4baa 100644 --- a/bin/addons/base/module/wizard/wizard_module_lang_install.py +++ b/bin/addons/base/module/wizard/wizard_module_lang_install.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/wizard/wizard_module_upgrade.py b/bin/addons/base/module/wizard/wizard_module_upgrade.py index c47796b32e9..051d6ca00c4 100644 --- a/bin/addons/base/module/wizard/wizard_module_upgrade.py +++ b/bin/addons/base/module/wizard/wizard_module_upgrade.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/wizard/wizard_update_module.py b/bin/addons/base/module/wizard/wizard_update_module.py index ff2adb0c4b4..d9548d5cdb9 100644 --- a/bin/addons/base/module/wizard/wizard_update_module.py +++ b/bin/addons/base/module/wizard/wizard_update_module.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/module/wizard/wizard_update_translations.py b/bin/addons/base/module/wizard/wizard_update_translations.py index 8e2dee7c3c3..85914ff0164 100644 --- a/bin/addons/base/module/wizard/wizard_update_translations.py +++ b/bin/addons/base/module/wizard/wizard_update_translations.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/__init__.py b/bin/addons/base/res/__init__.py index c715c18226f..d8b335f590f 100644 --- a/bin/addons/base/res/__init__.py +++ b/bin/addons/base/res/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/bank.py b/bin/addons/base/res/bank.py index ba06d7d5f2b..77151a9e801 100644 --- a/bin/addons/base/res/bank.py +++ b/bin/addons/base/res/bank.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/country.py b/bin/addons/base/res/country.py index 7528b7af585..6ca011c8820 100644 --- a/bin/addons/base/res/country.py +++ b/bin/addons/base/res/country.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/ir_property.py b/bin/addons/base/res/ir_property.py index baf1f4938f0..10487bc34d1 100644 --- a/bin/addons/base/res/ir_property.py +++ b/bin/addons/base/res/ir_property.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/partner/__init__.py b/bin/addons/base/res/partner/__init__.py index e86821bc089..96d625bd3e1 100644 --- a/bin/addons/base/res/partner/__init__.py +++ b/bin/addons/base/res/partner/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/partner/crm.py b/bin/addons/base/res/partner/crm.py index 2878240f99c..c48c5bbddac 100644 --- a/bin/addons/base/res/partner/crm.py +++ b/bin/addons/base/res/partner/crm.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/partner/partner.py b/bin/addons/base/res/partner/partner.py index 93b6698e398..53d1b3f64e2 100644 --- a/bin/addons/base/res/partner/partner.py +++ b/bin/addons/base/res/partner/partner.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/partner/report/__init__.py b/bin/addons/base/res/partner/report/__init__.py index c82c406d00f..0a7dcc8620f 100644 --- a/bin/addons/base/res/partner/report/__init__.py +++ b/bin/addons/base/res/partner/report/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/partner/wizard/__init__.py b/bin/addons/base/res/partner/wizard/__init__.py index 6b3ae0977a0..b1f0addf5d4 100644 --- a/bin/addons/base/res/partner/wizard/__init__.py +++ b/bin/addons/base/res/partner/wizard/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/partner/wizard/wizard_clear_ids.py b/bin/addons/base/res/partner/wizard/wizard_clear_ids.py index a851d65f4c0..083380905f9 100644 --- a/bin/addons/base/res/partner/wizard/wizard_clear_ids.py +++ b/bin/addons/base/res/partner/wizard/wizard_clear_ids.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/partner/wizard/wizard_ean_check.py b/bin/addons/base/res/partner/wizard/wizard_ean_check.py index 80e12835dd5..cd757c232f5 100644 --- a/bin/addons/base/res/partner/wizard/wizard_ean_check.py +++ b/bin/addons/base/res/partner/wizard/wizard_ean_check.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/partner/wizard/wizard_sms.py b/bin/addons/base/res/partner/wizard/wizard_sms.py index 93744ec53fa..08359386a53 100644 --- a/bin/addons/base/res/partner/wizard/wizard_sms.py +++ b/bin/addons/base/res/partner/wizard/wizard_sms.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/partner/wizard/wizard_spam.py b/bin/addons/base/res/partner/wizard/wizard_spam.py index 41737323ff4..c08baa898a4 100644 --- a/bin/addons/base/res/partner/wizard/wizard_spam.py +++ b/bin/addons/base/res/partner/wizard/wizard_spam.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/res_company.py b/bin/addons/base/res/res_company.py index 339436527a5..6b19de4db72 100644 --- a/bin/addons/base/res/res_company.py +++ b/bin/addons/base/res/res_company.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/res_currency.py b/bin/addons/base/res/res_currency.py index 0ce4cbb3254..ecca19e1d4b 100644 --- a/bin/addons/base/res/res_currency.py +++ b/bin/addons/base/res/res_currency.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/res_lang.py b/bin/addons/base/res/res_lang.py index 8cf53e6e1cf..a2a1b5934da 100644 --- a/bin/addons/base/res/res_lang.py +++ b/bin/addons/base/res/res_lang.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/res_request.py b/bin/addons/base/res/res_request.py index 3032521e3b9..bdbc6c0bdac 100644 --- a/bin/addons/base/res/res_request.py +++ b/bin/addons/base/res/res_request.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/base/res/res_user.py b/bin/addons/base/res/res_user.py index 5d6d95c6bd8..49334986c94 100644 --- a/bin/addons/base/res/res_user.py +++ b/bin/addons/base/res/res_user.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/module_graph.py b/bin/addons/module_graph.py index b32e67c9b33..42fe6118d2a 100755 --- a/bin/addons/module_graph.py +++ b/bin/addons/module_graph.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/addons/quality_integration_server/base_quality_interrogation.py b/bin/addons/quality_integration_server/base_quality_interrogation.py index b79c8a5ff77..4047f1ab195 100755 --- a/bin/addons/quality_integration_server/base_quality_interrogation.py +++ b/bin/addons/quality_integration_server/base_quality_interrogation.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/ir/__init__.py b/bin/ir/__init__.py index 1a5dd141fa2..8a40066ca9e 100644 --- a/bin/ir/__init__.py +++ b/bin/ir/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/ir/ir.py b/bin/ir/ir.py index 88084f5ac7a..109faf95872 100644 --- a/bin/ir/ir.py +++ b/bin/ir/ir.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/mako/__init__.py b/bin/mako/__init__.py index adced7f40d2..3d29ba5fe07 100755 --- a/bin/mako/__init__.py +++ b/bin/mako/__init__.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # __init__.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # diff --git a/bin/mako/ast.py b/bin/mako/ast.py index 6d4ef029871..c6a4225fc0e 100755 --- a/bin/mako/ast.py +++ b/bin/mako/ast.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # ast.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # diff --git a/bin/mako/cache.py b/bin/mako/cache.py index 43f7317861e..51d913a58b8 100755 --- a/bin/mako/cache.py +++ b/bin/mako/cache.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from mako import exceptions try: diff --git a/bin/mako/codegen.py b/bin/mako/codegen.py index f02b8de1520..ee01713bd2f 100755 --- a/bin/mako/codegen.py +++ b/bin/mako/codegen.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # codegen.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # diff --git a/bin/mako/exceptions.py b/bin/mako/exceptions.py index 1e789640b7b..b2a708892dc 100755 --- a/bin/mako/exceptions.py +++ b/bin/mako/exceptions.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # exceptions.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # diff --git a/bin/mako/ext/__init__.py b/bin/mako/ext/__init__.py index e69de29bb2d..f178e236324 100755 --- a/bin/mako/ext/__init__.py +++ b/bin/mako/ext/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## \ No newline at end of file diff --git a/bin/mako/ext/autohandler.py b/bin/mako/ext/autohandler.py index 3025f8e8e30..e63b005accf 100755 --- a/bin/mako/ext/autohandler.py +++ b/bin/mako/ext/autohandler.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """adds autohandler functionality to Mako templates. requires that the TemplateLookup class is used with templates. diff --git a/bin/mako/ext/babelplugin.py b/bin/mako/ext/babelplugin.py index e16e133c676..54d266877ba 100755 --- a/bin/mako/ext/babelplugin.py +++ b/bin/mako/ext/babelplugin.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """gettext message extraction via Babel: http://babel.edgewall.org/""" from StringIO import StringIO diff --git a/bin/mako/ext/preprocessors.py b/bin/mako/ext/preprocessors.py index 601ac0de2cb..ac7618b979e 100755 --- a/bin/mako/ext/preprocessors.py +++ b/bin/mako/ext/preprocessors.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- """preprocessing functions, used with the 'preprocessor' argument on Template, TemplateLookup""" import re diff --git a/bin/mako/ext/pygmentplugin.py b/bin/mako/ext/pygmentplugin.py index 09ffe127767..aa61d75678e 100755 --- a/bin/mako/ext/pygmentplugin.py +++ b/bin/mako/ext/pygmentplugin.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import re try: set diff --git a/bin/mako/ext/turbogears.py b/bin/mako/ext/turbogears.py index f82f907875e..c86f8d534df 100755 --- a/bin/mako/ext/turbogears.py +++ b/bin/mako/ext/turbogears.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- import re, inspect from mako.lookup import TemplateLookup from mako.template import Template diff --git a/bin/mako/filters.py b/bin/mako/filters.py index f2522415138..1e2f4d9cebf 100755 --- a/bin/mako/filters.py +++ b/bin/mako/filters.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # filters.py # Copyright (C) 2006, 2007, 2008 Geoffrey T. Dairiki and Michael Bayer # diff --git a/bin/mako/lexer.py b/bin/mako/lexer.py index c5c39dff888..057c5f2a24c 100755 --- a/bin/mako/lexer.py +++ b/bin/mako/lexer.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # lexer.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # diff --git a/bin/mako/lookup.py b/bin/mako/lookup.py index 892625470e1..a778c217fb7 100755 --- a/bin/mako/lookup.py +++ b/bin/mako/lookup.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # lookup.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # diff --git a/bin/mako/parsetree.py b/bin/mako/parsetree.py index 8b53ff58226..9c5bd672dae 100755 --- a/bin/mako/parsetree.py +++ b/bin/mako/parsetree.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # parsetree.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # diff --git a/bin/mako/pygen.py b/bin/mako/pygen.py index b73325fc6c5..cdad023b7f6 100755 --- a/bin/mako/pygen.py +++ b/bin/mako/pygen.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # pygen.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # diff --git a/bin/mako/pyparser.py b/bin/mako/pyparser.py index c79692caab0..e8468f698eb 100755 --- a/bin/mako/pyparser.py +++ b/bin/mako/pyparser.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # ast.py # Copyright (C) Mako developers # diff --git a/bin/mako/runtime.py b/bin/mako/runtime.py index 1aab3249013..79e304e29d5 100755 --- a/bin/mako/runtime.py +++ b/bin/mako/runtime.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # runtime.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # diff --git a/bin/mako/template.py b/bin/mako/template.py index 810d274bd94..2d45393e089 100755 --- a/bin/mako/template.py +++ b/bin/mako/template.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # template.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # diff --git a/bin/mako/util.py b/bin/mako/util.py index 0141093043c..0aea7727475 100755 --- a/bin/mako/util.py +++ b/bin/mako/util.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # util.py # Copyright (C) 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # diff --git a/bin/netsvc.py b/bin/netsvc.py index 8b121e609fe..387541ad55c 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/openerp-server.py b/bin/openerp-server.py index 8e8115fe18a..3d07c9de047 100755 --- a/bin/openerp-server.py +++ b/bin/openerp-server.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/osv/__init__.py b/bin/osv/__init__.py index 74a005c0efa..630090954e6 100644 --- a/bin/osv/__init__.py +++ b/bin/osv/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/osv/expression.py b/bin/osv/expression.py index 72ae2c8e30f..af2868fb2c7 100644 --- a/bin/osv/expression.py +++ b/bin/osv/expression.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution @@ -309,7 +309,7 @@ class expression(object): if leaf == self.__DUMMY_LEAF: return ('(1=1)', []) left, operator, right = leaf - + if operator == 'inselect': query = '(%s.%s in (%s))' % (table._table, left, right[0]) params = right[1] diff --git a/bin/osv/fields.py b/bin/osv/fields.py index 6838b971bac..074dcad5c5e 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/osv/orm.py b/bin/osv/orm.py index c5ce3496193..1767de14101 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution @@ -197,7 +197,7 @@ class browse_record(object): raise Exception(_('Language with code "%s" is not defined in your system !\nDefine it through the Administration menu.') % (lang,)) lang_obj = self.pool.get('res.lang').browse(self._cr, self._uid,lang_obj_ids[0]) - for n, f in ffields: + for n, f in ffields: if f._type in self._fields_process: for d in datas: d[n] = self._fields_process[f._type](d[n]) diff --git a/bin/osv/osv.py b/bin/osv/osv.py index bf4f179fc4a..78d84538677 100644 --- a/bin/osv/osv.py +++ b/bin/osv/osv.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/pooler.py b/bin/pooler.py index 9890d1cbe6b..81382924e26 100644 --- a/bin/pooler.py +++ b/bin/pooler.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/pychart/__init__.py b/bin/pychart/__init__.py index 8528d30445b..a45c23cc87f 100644 --- a/bin/pychart/__init__.py +++ b/bin/pychart/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) diff --git a/bin/pychart/afm/AvantGarde_Book.py b/bin/pychart/afm/AvantGarde_Book.py index 62afd5ae7a2..bfaaec0050d 100644 --- a/bin/pychart/afm/AvantGarde_Book.py +++ b/bin/pychart/afm/AvantGarde_Book.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font AvantGarde-Book (path: /usr/share/fonts/afms/adobe/pagk8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/AvantGarde_BookOblique.py b/bin/pychart/afm/AvantGarde_BookOblique.py index 11c29aa416a..1db8aa7dddf 100644 --- a/bin/pychart/afm/AvantGarde_BookOblique.py +++ b/bin/pychart/afm/AvantGarde_BookOblique.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font AvantGarde-BookOblique (path: /usr/share/fonts/afms/adobe/pagko8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/AvantGarde_Demi.py b/bin/pychart/afm/AvantGarde_Demi.py index ee69d2fbd74..295b3e7d7c2 100644 --- a/bin/pychart/afm/AvantGarde_Demi.py +++ b/bin/pychart/afm/AvantGarde_Demi.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font AvantGarde-Demi (path: /usr/share/fonts/afms/adobe/pagd8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/AvantGarde_DemiOblique.py b/bin/pychart/afm/AvantGarde_DemiOblique.py index 09a08c53447..7b6c04feb52 100644 --- a/bin/pychart/afm/AvantGarde_DemiOblique.py +++ b/bin/pychart/afm/AvantGarde_DemiOblique.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font AvantGarde-DemiOblique (path: /usr/share/fonts/afms/adobe/pagdo8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Bookman_Demi.py b/bin/pychart/afm/Bookman_Demi.py index 199315d3a8a..255593de85e 100644 --- a/bin/pychart/afm/Bookman_Demi.py +++ b/bin/pychart/afm/Bookman_Demi.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Bookman-Demi (path: /usr/share/fonts/afms/adobe/pbkd8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Bookman_DemiItalic.py b/bin/pychart/afm/Bookman_DemiItalic.py index 9e13c8f6516..865ebd45917 100644 --- a/bin/pychart/afm/Bookman_DemiItalic.py +++ b/bin/pychart/afm/Bookman_DemiItalic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Bookman-DemiItalic (path: /usr/share/fonts/afms/adobe/pbkdi8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Bookman_Light.py b/bin/pychart/afm/Bookman_Light.py index 031f86a6206..924e2110b7f 100644 --- a/bin/pychart/afm/Bookman_Light.py +++ b/bin/pychart/afm/Bookman_Light.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Bookman-Light (path: /usr/share/fonts/afms/adobe/pbkl8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Bookman_LightItalic.py b/bin/pychart/afm/Bookman_LightItalic.py index 8a3d8d26fe8..55a3bca71a6 100644 --- a/bin/pychart/afm/Bookman_LightItalic.py +++ b/bin/pychart/afm/Bookman_LightItalic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Bookman-LightItalic (path: /usr/share/fonts/afms/adobe/pbkli8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Courier.py b/bin/pychart/afm/Courier.py index 92da5498f3e..66d6aca798d 100644 --- a/bin/pychart/afm/Courier.py +++ b/bin/pychart/afm/Courier.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Courier (path: /usr/share/fonts/afms/adobe/pcrr8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Courier_Bold.py b/bin/pychart/afm/Courier_Bold.py index 3b8d493e022..39575e834da 100644 --- a/bin/pychart/afm/Courier_Bold.py +++ b/bin/pychart/afm/Courier_Bold.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Courier-Bold (path: /usr/share/fonts/afms/adobe/pcrb8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Courier_BoldOblique.py b/bin/pychart/afm/Courier_BoldOblique.py index 44abc0b75be..9724375ef1d 100644 --- a/bin/pychart/afm/Courier_BoldOblique.py +++ b/bin/pychart/afm/Courier_BoldOblique.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Courier-BoldOblique (path: /usr/share/fonts/afms/adobe/pcrbo8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Courier_Oblique.py b/bin/pychart/afm/Courier_Oblique.py index 834d14bcacd..b95fd09170f 100644 --- a/bin/pychart/afm/Courier_Oblique.py +++ b/bin/pychart/afm/Courier_Oblique.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Courier-Oblique (path: /usr/share/fonts/afms/adobe/pcrro8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Helvetica.py b/bin/pychart/afm/Helvetica.py index b9a0f775ed2..01e829d3be9 100644 --- a/bin/pychart/afm/Helvetica.py +++ b/bin/pychart/afm/Helvetica.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Helvetica (path: /usr/share/fonts/afms/adobe/phvr8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Helvetica_Bold.py b/bin/pychart/afm/Helvetica_Bold.py index 1e6b332d384..b3d3b2175b8 100644 --- a/bin/pychart/afm/Helvetica_Bold.py +++ b/bin/pychart/afm/Helvetica_Bold.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Helvetica-Bold (path: /usr/share/fonts/afms/adobe/phvb8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Helvetica_BoldOblique.py b/bin/pychart/afm/Helvetica_BoldOblique.py index 98e8ea9edde..c439205c602 100644 --- a/bin/pychart/afm/Helvetica_BoldOblique.py +++ b/bin/pychart/afm/Helvetica_BoldOblique.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Helvetica-BoldOblique (path: /usr/share/fonts/afms/adobe/phvbo8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Helvetica_Light.py b/bin/pychart/afm/Helvetica_Light.py index 69128431e80..7f7eb864d88 100644 --- a/bin/pychart/afm/Helvetica_Light.py +++ b/bin/pychart/afm/Helvetica_Light.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Helvetica-Light (path: /usr/share/fonts/afms/adobe/phvl8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Helvetica_LightOblique.py b/bin/pychart/afm/Helvetica_LightOblique.py index efc82aabe4f..5da8c82f48a 100644 --- a/bin/pychart/afm/Helvetica_LightOblique.py +++ b/bin/pychart/afm/Helvetica_LightOblique.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Helvetica-LightOblique (path: /usr/share/fonts/afms/adobe/phvlo8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Helvetica_Narrow.py b/bin/pychart/afm/Helvetica_Narrow.py index 4b570843741..3c7a78b0704 100644 --- a/bin/pychart/afm/Helvetica_Narrow.py +++ b/bin/pychart/afm/Helvetica_Narrow.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Helvetica-Narrow (path: /usr/share/fonts/afms/adobe/phvr8an.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Helvetica_Narrow_Bold.py b/bin/pychart/afm/Helvetica_Narrow_Bold.py index 009b6987003..d96f0648fed 100644 --- a/bin/pychart/afm/Helvetica_Narrow_Bold.py +++ b/bin/pychart/afm/Helvetica_Narrow_Bold.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Helvetica-Narrow-Bold (path: /usr/share/fonts/afms/adobe/phvb8an.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Helvetica_Narrow_BoldOblique.py b/bin/pychart/afm/Helvetica_Narrow_BoldOblique.py index 98d7e2ef4a7..6445397cb2a 100644 --- a/bin/pychart/afm/Helvetica_Narrow_BoldOblique.py +++ b/bin/pychart/afm/Helvetica_Narrow_BoldOblique.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Helvetica-Narrow-BoldOblique (path: /usr/share/fonts/afms/adobe/phvbo8an.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Helvetica_Narrow_Oblique.py b/bin/pychart/afm/Helvetica_Narrow_Oblique.py index 8612d7211b0..23675c1b3ba 100644 --- a/bin/pychart/afm/Helvetica_Narrow_Oblique.py +++ b/bin/pychart/afm/Helvetica_Narrow_Oblique.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Helvetica-Narrow-Oblique (path: /usr/share/fonts/afms/adobe/phvro8an.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Helvetica_Oblique.py b/bin/pychart/afm/Helvetica_Oblique.py index b8ee7e383e6..10117189f69 100644 --- a/bin/pychart/afm/Helvetica_Oblique.py +++ b/bin/pychart/afm/Helvetica_Oblique.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Helvetica-Oblique (path: /usr/share/fonts/afms/adobe/phvro8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/NewCenturySchlbk_Bold.py b/bin/pychart/afm/NewCenturySchlbk_Bold.py index a553f31bb20..f37530e92e8 100644 --- a/bin/pychart/afm/NewCenturySchlbk_Bold.py +++ b/bin/pychart/afm/NewCenturySchlbk_Bold.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font NewCenturySchlbk-Bold (path: /usr/share/fonts/afms/adobe/pncb8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/NewCenturySchlbk_BoldItalic.py b/bin/pychart/afm/NewCenturySchlbk_BoldItalic.py index 7daa58ee2ff..a5c5c172414 100644 --- a/bin/pychart/afm/NewCenturySchlbk_BoldItalic.py +++ b/bin/pychart/afm/NewCenturySchlbk_BoldItalic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font NewCenturySchlbk-BoldItalic (path: /usr/share/fonts/afms/adobe/pncbi8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/NewCenturySchlbk_Italic.py b/bin/pychart/afm/NewCenturySchlbk_Italic.py index cfe6b4f060b..612a8c60b27 100644 --- a/bin/pychart/afm/NewCenturySchlbk_Italic.py +++ b/bin/pychart/afm/NewCenturySchlbk_Italic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font NewCenturySchlbk-Italic (path: /usr/share/fonts/afms/adobe/pncri8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/NewCenturySchlbk_Roman.py b/bin/pychart/afm/NewCenturySchlbk_Roman.py index 07e62553fed..010b8c7042a 100644 --- a/bin/pychart/afm/NewCenturySchlbk_Roman.py +++ b/bin/pychart/afm/NewCenturySchlbk_Roman.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font NewCenturySchlbk-Roman (path: /usr/share/fonts/afms/adobe/pncr8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Palatino_Bold.py b/bin/pychart/afm/Palatino_Bold.py index ecc968966cb..cd0394bdd69 100644 --- a/bin/pychart/afm/Palatino_Bold.py +++ b/bin/pychart/afm/Palatino_Bold.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Palatino-Bold (path: /usr/share/fonts/afms/adobe/pplb8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Palatino_BoldItalic.py b/bin/pychart/afm/Palatino_BoldItalic.py index 64c12005939..dbea3e12343 100644 --- a/bin/pychart/afm/Palatino_BoldItalic.py +++ b/bin/pychart/afm/Palatino_BoldItalic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Palatino-BoldItalic (path: /usr/share/fonts/afms/adobe/pplbi8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Palatino_Italic.py b/bin/pychart/afm/Palatino_Italic.py index 9e22479089d..e9618f5ade2 100644 --- a/bin/pychart/afm/Palatino_Italic.py +++ b/bin/pychart/afm/Palatino_Italic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Palatino-Italic (path: /usr/share/fonts/afms/adobe/pplri8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Palatino_Roman.py b/bin/pychart/afm/Palatino_Roman.py index ada67fc41da..c846b9ad9ba 100644 --- a/bin/pychart/afm/Palatino_Roman.py +++ b/bin/pychart/afm/Palatino_Roman.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Palatino-Roman (path: /usr/share/fonts/afms/adobe/pplr8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Symbol.py b/bin/pychart/afm/Symbol.py index a9e7b9af4d8..9ddd708a8df 100644 --- a/bin/pychart/afm/Symbol.py +++ b/bin/pychart/afm/Symbol.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Symbol (path: /usr/share/fonts/afms/adobe/psyr.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Times_Bold.py b/bin/pychart/afm/Times_Bold.py index 6db5447bfbf..c966cfc6c6c 100644 --- a/bin/pychart/afm/Times_Bold.py +++ b/bin/pychart/afm/Times_Bold.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Times-Bold (path: /usr/share/fonts/afms/adobe/ptmb8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Times_BoldItalic.py b/bin/pychart/afm/Times_BoldItalic.py index 3188d46f813..75b0c316128 100644 --- a/bin/pychart/afm/Times_BoldItalic.py +++ b/bin/pychart/afm/Times_BoldItalic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Times-BoldItalic (path: /usr/share/fonts/afms/adobe/ptmbi8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Times_Italic.py b/bin/pychart/afm/Times_Italic.py index 4a4df2b8a98..c057c8ff2b7 100644 --- a/bin/pychart/afm/Times_Italic.py +++ b/bin/pychart/afm/Times_Italic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Times-Italic (path: /usr/share/fonts/afms/adobe/ptmri8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Times_Roman.py b/bin/pychart/afm/Times_Roman.py index a03ee6591e4..b2eb7a0bb90 100644 --- a/bin/pychart/afm/Times_Roman.py +++ b/bin/pychart/afm/Times_Roman.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Times-Roman (path: /usr/share/fonts/afms/adobe/ptmr8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Utopia_Bold.py b/bin/pychart/afm/Utopia_Bold.py index 5f9c25c158f..d7f5cd519ae 100644 --- a/bin/pychart/afm/Utopia_Bold.py +++ b/bin/pychart/afm/Utopia_Bold.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Utopia-Bold (path: /usr/share/fonts/afms/adobe/putb8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Utopia_BoldItalic.py b/bin/pychart/afm/Utopia_BoldItalic.py index 9ef88006c6b..f29af4a95f4 100644 --- a/bin/pychart/afm/Utopia_BoldItalic.py +++ b/bin/pychart/afm/Utopia_BoldItalic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Utopia-BoldItalic (path: /usr/share/fonts/afms/adobe/putbi8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Utopia_Italic.py b/bin/pychart/afm/Utopia_Italic.py index 920c1271193..33eb26837d8 100644 --- a/bin/pychart/afm/Utopia_Italic.py +++ b/bin/pychart/afm/Utopia_Italic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Utopia-Italic (path: /usr/share/fonts/afms/adobe/putri8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/Utopia_Regular.py b/bin/pychart/afm/Utopia_Regular.py index 656c6a58d7d..0a61b2ee497 100644 --- a/bin/pychart/afm/Utopia_Regular.py +++ b/bin/pychart/afm/Utopia_Regular.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font Utopia-Regular (path: /usr/share/fonts/afms/adobe/putr8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/ZapfChancery_MediumItalic.py b/bin/pychart/afm/ZapfChancery_MediumItalic.py index 00e0e93f809..86622dad380 100644 --- a/bin/pychart/afm/ZapfChancery_MediumItalic.py +++ b/bin/pychart/afm/ZapfChancery_MediumItalic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font ZapfChancery-MediumItalic (path: /usr/share/fonts/afms/adobe/pzcmi8a.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/ZapfDingbats.py b/bin/pychart/afm/ZapfDingbats.py index d93cdda3893..acdfcd3b178 100644 --- a/bin/pychart/afm/ZapfDingbats.py +++ b/bin/pychart/afm/ZapfDingbats.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # AFM font ZapfDingbats (path: /usr/share/fonts/afms/adobe/pzdr.afm). # Derived from Ghostscript distribution. # Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code. diff --git a/bin/pychart/afm/__init__.py b/bin/pychart/afm/__init__.py index b42abfb7426..83ce5c3234b 100644 --- a/bin/pychart/afm/__init__.py +++ b/bin/pychart/afm/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/pychart/afm/dir.py b/bin/pychart/afm/dir.py index a978c1b85b7..e48804e6a88 100644 --- a/bin/pychart/afm/dir.py +++ b/bin/pychart/afm/dir.py @@ -1,2 +1,3 @@ -afm = {} - +# -*- coding: utf-8 -*- +afm = {} + diff --git a/bin/pychart/area.py b/bin/pychart/area.py index a0e76876ec0..0f714d068d8 100644 --- a/bin/pychart/area.py +++ b/bin/pychart/area.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/area_doc.py b/bin/pychart/area_doc.py index 63f8f6ae430..a23e71bc31f 100644 --- a/bin/pychart/area_doc.py +++ b/bin/pychart/area_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: plots(type:list) default="Used only internally by pychart.". diff --git a/bin/pychart/arrow.py b/bin/pychart/arrow.py index e0b931fb8a2..4271c36f66b 100644 --- a/bin/pychart/arrow.py +++ b/bin/pychart/arrow.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/arrow_doc.py b/bin/pychart/arrow_doc.py index f76958d9864..38391a9d886 100644 --- a/bin/pychart/arrow_doc.py +++ b/bin/pychart/arrow_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: head_color(type:color.T) default="The color of the arrow head.". diff --git a/bin/pychart/axis.py b/bin/pychart/axis.py index 64d3fd2409d..e236188b1e6 100644 --- a/bin/pychart/axis.py +++ b/bin/pychart/axis.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/axis_doc.py b/bin/pychart/axis_doc.py index 48184d405a5..43fb4046769 100644 --- a/bin/pychart/axis_doc.py +++ b/bin/pychart/axis_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc_x="""Attributes supported by this class are: draw_tics_above(type:int) default="If true, tick lines and labels are drawn above the axis line.". diff --git a/bin/pychart/axis_x_doc.py b/bin/pychart/axis_x_doc.py index 899b2b0b1de..ca2a377f881 100644 --- a/bin/pychart/axis_x_doc.py +++ b/bin/pychart/axis_x_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/axis_y_doc.py b/bin/pychart/axis_y_doc.py index e254f0ef7a8..354afb25884 100644 --- a/bin/pychart/axis_y_doc.py +++ b/bin/pychart/axis_y_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/bar_plot.py b/bin/pychart/bar_plot.py index 7e9a8d815f7..b332626949d 100644 --- a/bin/pychart/bar_plot.py +++ b/bin/pychart/bar_plot.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/bar_plot_doc.py b/bin/pychart/bar_plot_doc.py index c47492ef280..c262367b9e5 100644 --- a/bin/pychart/bar_plot_doc.py +++ b/bin/pychart/bar_plot_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: cluster_sep(type:length in points (\\xref{unit})) default="The separation between diff --git a/bin/pychart/basecanvas.py b/bin/pychart/basecanvas.py index bef3573cb44..d32a8ca76ab 100644 --- a/bin/pychart/basecanvas.py +++ b/bin/pychart/basecanvas.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/canvas.py b/bin/pychart/canvas.py index cadceb3b5ce..bb220954f59 100644 --- a/bin/pychart/canvas.py +++ b/bin/pychart/canvas.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/category_coord.py b/bin/pychart/category_coord.py index a84d3eb5d73..60a3def7277 100644 --- a/bin/pychart/category_coord.py +++ b/bin/pychart/category_coord.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/chart_data.py b/bin/pychart/chart_data.py index 6e252c8d585..dc805ee1762 100644 --- a/bin/pychart/chart_data.py +++ b/bin/pychart/chart_data.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/chart_object.py b/bin/pychart/chart_object.py index f23fbadd0c0..7ebfc1829c1 100644 --- a/bin/pychart/chart_object.py +++ b/bin/pychart/chart_object.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/color.py b/bin/pychart/color.py index 3e1066d319d..30b1cc9b00d 100644 --- a/bin/pychart/color.py +++ b/bin/pychart/color.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/color_doc.py b/bin/pychart/color_doc.py index 65fa6446a16..c8f0e0317de 100644 --- a/bin/pychart/color_doc.py +++ b/bin/pychart/color_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: r(type:number) default="The intensity of red. The value is between 0 and 1.". diff --git a/bin/pychart/coord.py b/bin/pychart/coord.py index 3c911d2a42a..f448ec8b038 100644 --- a/bin/pychart/coord.py +++ b/bin/pychart/coord.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/doc_support.py b/bin/pychart/doc_support.py index 32537a7437c..9d4e0f84cc7 100644 --- a/bin/pychart/doc_support.py +++ b/bin/pychart/doc_support.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/empty_docs.py b/bin/pychart/empty_docs.py index 20408906da0..b7b4e239534 100644 --- a/bin/pychart/empty_docs.py +++ b/bin/pychart/empty_docs.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/error_bar.py b/bin/pychart/error_bar.py index 6abecffdb19..7ff7923b60f 100644 --- a/bin/pychart/error_bar.py +++ b/bin/pychart/error_bar.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/error_bar_doc.py b/bin/pychart/error_bar_doc.py index de2362dd50c..5218b1c3e5b 100644 --- a/bin/pychart/error_bar_doc.py +++ b/bin/pychart/error_bar_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc_1="""Attributes supported by this class are: line_style(type:line_style.T) default="". diff --git a/bin/pychart/fill_style.py b/bin/pychart/fill_style.py index 1cddd3d9601..08f73177d24 100644 --- a/bin/pychart/fill_style.py +++ b/bin/pychart/fill_style.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/fill_style_doc.py b/bin/pychart/fill_style_doc.py index 6274e1b2a89..dc6cd5ed7c1 100644 --- a/bin/pychart/fill_style_doc.py +++ b/bin/pychart/fill_style_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: bgcolor(type:color.T) default="The background color.". diff --git a/bin/pychart/font.py b/bin/pychart/font.py index 593666bb015..c2a54144d06 100644 --- a/bin/pychart/font.py +++ b/bin/pychart/font.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/generate_docs.py b/bin/pychart/generate_docs.py index 9e0461249a2..0d9646677cf 100644 --- a/bin/pychart/generate_docs.py +++ b/bin/pychart/generate_docs.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/gs_frontend.py b/bin/pychart/gs_frontend.py index 144f19de109..8e587b99689 100644 --- a/bin/pychart/gs_frontend.py +++ b/bin/pychart/gs_frontend.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/interval_bar_plot.py b/bin/pychart/interval_bar_plot.py index 084ad296f60..5fb1bd138d4 100644 --- a/bin/pychart/interval_bar_plot.py +++ b/bin/pychart/interval_bar_plot.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/legend.py b/bin/pychart/legend.py index c45f6ff5729..8cd7e230921 100644 --- a/bin/pychart/legend.py +++ b/bin/pychart/legend.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/legend_doc.py b/bin/pychart/legend_doc.py index 2e642fc3b13..dacbdafa9c6 100644 --- a/bin/pychart/legend_doc.py +++ b/bin/pychart/legend_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: inter_col_sep(type:length in points (\\xref{unit})) default="Space between each column in the legend.". diff --git a/bin/pychart/line_plot.py b/bin/pychart/line_plot.py index 81b995c86e8..d80d5d69231 100644 --- a/bin/pychart/line_plot.py +++ b/bin/pychart/line_plot.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/line_plot_doc.py b/bin/pychart/line_plot_doc.py index a1dfe17749c..ac6ff3b21c7 100644 --- a/bin/pychart/line_plot_doc.py +++ b/bin/pychart/line_plot_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: y_qerror_minus_col(type:int) default="<>". diff --git a/bin/pychart/line_style.py b/bin/pychart/line_style.py index c47e09cf669..861ddc74355 100644 --- a/bin/pychart/line_style.py +++ b/bin/pychart/line_style.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/line_style_doc.py b/bin/pychart/line_style_doc.py index b936e805122..e7dc4e7f379 100644 --- a/bin/pychart/line_style_doc.py +++ b/bin/pychart/line_style_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: color(type:color.T) default="The color of the line.". diff --git a/bin/pychart/linear_coord.py b/bin/pychart/linear_coord.py index e54d1789f24..b21075c1860 100644 --- a/bin/pychart/linear_coord.py +++ b/bin/pychart/linear_coord.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/log_coord.py b/bin/pychart/log_coord.py index e40308c9cf8..22a5b22c8f8 100644 --- a/bin/pychart/log_coord.py +++ b/bin/pychart/log_coord.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/object_set.py b/bin/pychart/object_set.py index 7d3c9ab70d7..9fd22b9e4a7 100644 --- a/bin/pychart/object_set.py +++ b/bin/pychart/object_set.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/pdfcanvas.py b/bin/pychart/pdfcanvas.py index 0413e551946..620bb8c1981 100644 --- a/bin/pychart/pdfcanvas.py +++ b/bin/pychart/pdfcanvas.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/pie_plot.py b/bin/pychart/pie_plot.py index c6f405a7ae9..b5f14bcde2f 100644 --- a/bin/pychart/pie_plot.py +++ b/bin/pychart/pie_plot.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/pie_plot_doc.py b/bin/pychart/pie_plot_doc.py index ae80d0a6b88..e7989085550 100644 --- a/bin/pychart/pie_plot_doc.py +++ b/bin/pychart/pie_plot_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: label_fill_style(type:fill_style.T) default="The fill style of the frame surrounding each label.". diff --git a/bin/pychart/pngcanvas.py b/bin/pychart/pngcanvas.py index b0e95960a06..5be7b33bbf6 100644 --- a/bin/pychart/pngcanvas.py +++ b/bin/pychart/pngcanvas.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/pscanvas.py b/bin/pychart/pscanvas.py index 7b92b6d6ce2..61b7dbfb8ad 100644 --- a/bin/pychart/pscanvas.py +++ b/bin/pychart/pscanvas.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/pychart_types.py b/bin/pychart/pychart_types.py index 269b83ef31d..e8d8a4174f4 100644 --- a/bin/pychart/pychart_types.py +++ b/bin/pychart/pychart_types.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # @@ -11,60 +12,60 @@ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # -import pychart_util -import types -AnyType = 9998 - -def CoordType(val): - if type(val) != types.TupleType and type(val) != types.ListType: - return (" not a valid coordinate.") - if len(val) != 2: - return "Coordinate must be a pair of numbers.\n" - if val[0] != None: - error = NumType(val[0]) - if error: return error - if val[1] != None: - error = NumType(val[1]) - if error: return error - return None - -def IntervalType(val): - if type(val) in (types.IntType, types.LongType, - types.FloatType, types.FunctionType): - return None - return "Expecting a number or a function" - -def CoordOrNoneType(val): - if type(val) not in (types.TupleType, types.ListType): - return "Expecting a tuple or a list." - if len(val) != 2: - return "Coordinate must be a pair of numbers.\n" - for v in val: - if v != None and NumType(val[0]) != None: - return "Expecting a pair of numbers" - return None - -def NumType(val): - if type(val) in (types.IntType, types.LongType, types.FloatType): - return None - else: - return "Expecting a number, found \"" + str(val) + "\"" - -def UnitType(val): - if type(val) in (types.IntType, types.LongType, types.FloatType): - return None - else: - return "Expecting a unit, found \"" + str(val) + "\"" - -def ShadowType(val): - if type(val) not in (types.TupleType, types.ListType): - return "Expecting tuple or list." - if len(val) != 3: - return "Expecting (xoff, yoff, fill)." - return None - -def FormatType(val): - if type(val) in (types.StringType, types.FunctionType): - return None - return "Format must be a string or a function" - +import pychart_util +import types +AnyType = 9998 + +def CoordType(val): + if type(val) != types.TupleType and type(val) != types.ListType: + return (" not a valid coordinate.") + if len(val) != 2: + return "Coordinate must be a pair of numbers.\n" + if val[0] != None: + error = NumType(val[0]) + if error: return error + if val[1] != None: + error = NumType(val[1]) + if error: return error + return None + +def IntervalType(val): + if type(val) in (types.IntType, types.LongType, + types.FloatType, types.FunctionType): + return None + return "Expecting a number or a function" + +def CoordOrNoneType(val): + if type(val) not in (types.TupleType, types.ListType): + return "Expecting a tuple or a list." + if len(val) != 2: + return "Coordinate must be a pair of numbers.\n" + for v in val: + if v != None and NumType(val[0]) != None: + return "Expecting a pair of numbers" + return None + +def NumType(val): + if type(val) in (types.IntType, types.LongType, types.FloatType): + return None + else: + return "Expecting a number, found \"" + str(val) + "\"" + +def UnitType(val): + if type(val) in (types.IntType, types.LongType, types.FloatType): + return None + else: + return "Expecting a unit, found \"" + str(val) + "\"" + +def ShadowType(val): + if type(val) not in (types.TupleType, types.ListType): + return "Expecting tuple or list." + if len(val) != 3: + return "Expecting (xoff, yoff, fill)." + return None + +def FormatType(val): + if type(val) in (types.StringType, types.FunctionType): + return None + return "Format must be a string or a function" + diff --git a/bin/pychart/pychart_util.py b/bin/pychart/pychart_util.py index a7c0eace35d..13b487b5543 100644 --- a/bin/pychart/pychart_util.py +++ b/bin/pychart/pychart_util.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/range_plot.py b/bin/pychart/range_plot.py index 1fe64338244..dc4b2edd8b6 100644 --- a/bin/pychart/range_plot.py +++ b/bin/pychart/range_plot.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/range_plot_doc.py b/bin/pychart/range_plot_doc.py index 6dcf4250f0b..28700d5378e 100644 --- a/bin/pychart/range_plot_doc.py +++ b/bin/pychart/range_plot_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: xcol(type:int) default="The column, within attribute "data", from which the X values of sample points are extracted. <>". diff --git a/bin/pychart/rose_plot.py b/bin/pychart/rose_plot.py index dcfd06074d4..1f54a4e7cb6 100644 --- a/bin/pychart/rose_plot.py +++ b/bin/pychart/rose_plot.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/scaling.py b/bin/pychart/scaling.py index 1fe7359b9f7..02dd0360d30 100644 --- a/bin/pychart/scaling.py +++ b/bin/pychart/scaling.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/svgcanvas.py b/bin/pychart/svgcanvas.py index 8fdb40a7982..76fc2ce412c 100644 --- a/bin/pychart/svgcanvas.py +++ b/bin/pychart/svgcanvas.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/text_box.py b/bin/pychart/text_box.py index a624782f48d..481deda1317 100644 --- a/bin/pychart/text_box.py +++ b/bin/pychart/text_box.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/text_box_doc.py b/bin/pychart/text_box_doc.py index 6b38b841a1d..72145345bd8 100644 --- a/bin/pychart/text_box_doc.py +++ b/bin/pychart/text_box_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: loc(type:tuple) default="The location of the text box.". diff --git a/bin/pychart/theme.py b/bin/pychart/theme.py index 20ccc709136..a725e14d009 100644 --- a/bin/pychart/theme.py +++ b/bin/pychart/theme.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/tick_mark.py b/bin/pychart/tick_mark.py index 21c7777e72a..a632da24bbe 100644 --- a/bin/pychart/tick_mark.py +++ b/bin/pychart/tick_mark.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/tick_mark_doc.py b/bin/pychart/tick_mark_doc.py index d61e68f1310..61151668827 100644 --- a/bin/pychart/tick_mark_doc.py +++ b/bin/pychart/tick_mark_doc.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # automatically generated by generate_docs.py. doc="""Attributes supported by this class are: line_style(type:line_style.T) default="The line style of the tick mark.". diff --git a/bin/pychart/typechecker.py b/bin/pychart/typechecker.py index ce88ffa97ef..a119f909c1f 100644 --- a/bin/pychart/typechecker.py +++ b/bin/pychart/typechecker.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/version.py b/bin/pychart/version.py index 0b564a98d7a..4fe19c790fe 100644 --- a/bin/pychart/version.py +++ b/bin/pychart/version.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/x11canvas.py b/bin/pychart/x11canvas.py index fa432404830..bb1cacfefdc 100644 --- a/bin/pychart/x11canvas.py +++ b/bin/pychart/x11canvas.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/pychart/zap.py b/bin/pychart/zap.py index 2c8672c65c6..7291ed3275a 100644 --- a/bin/pychart/zap.py +++ b/bin/pychart/zap.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # diff --git a/bin/release.py b/bin/release.py index 935d2136460..24e75ff93fa 100644 --- a/bin/release.py +++ b/bin/release.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/__init__.py b/bin/report/__init__.py index 8c20feee389..4cadd711738 100644 --- a/bin/report/__init__.py +++ b/bin/report/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/common.py b/bin/report/common.py index 9f25ae5b82f..02b0c77deba 100644 --- a/bin/report/common.py +++ b/bin/report/common.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/custom.py b/bin/report/custom.py index 824c6c290fc..2c9fe0009bc 100644 --- a/bin/report/custom.py +++ b/bin/report/custom.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/int_to_text.py b/bin/report/int_to_text.py index b40a6575ccf..52c456a1295 100644 --- a/bin/report/int_to_text.py +++ b/bin/report/int_to_text.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/interface.py b/bin/report/interface.py index b1892c5de0c..c55582b04c0 100644 --- a/bin/report/interface.py +++ b/bin/report/interface.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/misc.py b/bin/report/misc.py index 24ea120e027..6167720677c 100644 --- a/bin/report/misc.py +++ b/bin/report/misc.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/preprocess.py b/bin/report/preprocess.py index 4e0bed3b49d..35234bc7ef1 100644 --- a/bin/report/preprocess.py +++ b/bin/report/preprocess.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/print_fnc.py b/bin/report/print_fnc.py index 4025b510a52..17f95c0d0e2 100644 --- a/bin/report/print_fnc.py +++ b/bin/report/print_fnc.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/print_xml.py b/bin/report/print_xml.py index 05f7e70378d..535285e6a69 100644 --- a/bin/report/print_xml.py +++ b/bin/report/print_xml.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/printscreen/__init__.py b/bin/report/printscreen/__init__.py index 2772b648934..b9dd9702b7c 100644 --- a/bin/report/printscreen/__init__.py +++ b/bin/report/printscreen/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/printscreen/ps_form.py b/bin/report/printscreen/ps_form.py index 31402bf1c54..60976577201 100644 --- a/bin/report/printscreen/ps_form.py +++ b/bin/report/printscreen/ps_form.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/printscreen/ps_list.py b/bin/report/printscreen/ps_list.py index 86e5adf4a93..2d3ee002633 100644 --- a/bin/report/printscreen/ps_list.py +++ b/bin/report/printscreen/ps_list.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/pyPdf/__init__.py b/bin/report/pyPdf/__init__.py index af02553da69..28360a93847 100644 --- a/bin/report/pyPdf/__init__.py +++ b/bin/report/pyPdf/__init__.py @@ -1,2 +1,3 @@ +# -*- coding: utf-8 -*- from pdf import PdfFileReader, PdfFileWriter __all__ = ["pdf"] diff --git a/bin/report/pyPdf/filters.py b/bin/report/pyPdf/filters.py index 7fe10fb4819..04bb7d9df55 100644 --- a/bin/report/pyPdf/filters.py +++ b/bin/report/pyPdf/filters.py @@ -1,252 +1,253 @@ -# vim: sw=4:expandtab:foldmethod=marker -# -# Copyright (c) 2006, Mathieu Fenniak -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - - -""" -Implementation of stream filters for PDF. -""" -__author__ = "Mathieu Fenniak" -__author_email__ = "biziqe@mathieu.fenniak.net" - -from utils import PdfReadError -try: - from cStringIO import StringIO -except ImportError: - from StringIO import StringIO - -try: - import zlib - def decompress(data): - return zlib.decompress(data) - def compress(data): - return zlib.compress(data) -except ImportError: - # Unable to import zlib. Attempt to use the System.IO.Compression - # library from the .NET framework. (IronPython only) - import System - from System import IO, Collections, Array - def _string_to_bytearr(buf): - retval = Array.CreateInstance(System.Byte, len(buf)) - for i in range(len(buf)): - retval[i] = ord(buf[i]) - return retval - def _bytearr_to_string(bytes): - retval = "" - for i in range(bytes.Length): - retval += chr(bytes[i]) - return retval - def _read_bytes(stream): - ms = IO.MemoryStream() - buf = Array.CreateInstance(System.Byte, 2048) - while True: - bytes = stream.Read(buf, 0, buf.Length) - if bytes == 0: - break - else: - ms.Write(buf, 0, bytes) - retval = ms.ToArray() - ms.Close() - return retval - def decompress(data): - bytes = _string_to_bytearr(data) - ms = IO.MemoryStream() - ms.Write(bytes, 0, bytes.Length) - ms.Position = 0 # fseek 0 - gz = IO.Compression.DeflateStream(ms, IO.Compression.CompressionMode.Decompress) - bytes = _read_bytes(gz) - retval = _bytearr_to_string(bytes) - gz.Close() - return retval - def compress(data): - bytes = _string_to_bytearr(data) - ms = IO.MemoryStream() - gz = IO.Compression.DeflateStream(ms, IO.Compression.CompressionMode.Compress, True) - gz.Write(bytes, 0, bytes.Length) - gz.Close() - ms.Position = 0 # fseek 0 - bytes = ms.ToArray() - retval = _bytearr_to_string(bytes) - ms.Close() - return retval - - -class FlateDecode(object): - def decode(data, decodeParms): - data = decompress(data) - predictor = 1 - if decodeParms: - predictor = decodeParms.get("/Predictor", 1) - # predictor 1 == no predictor - if predictor != 1: - columns = decodeParms["/Columns"] - # PNG prediction: - if predictor >= 10 and predictor <= 15: - output = StringIO() - # PNG prediction can vary from row to row - rowlength = columns + 1 - assert len(data) % rowlength == 0 - prev_rowdata = (0,) * rowlength - for row in xrange(len(data) / rowlength): - rowdata = [ord(x) for x in data[(row*rowlength):((row+1)*rowlength)]] - filterByte = rowdata[0] - if filterByte == 0: - pass - elif filterByte == 1: - for i in range(2, rowlength): - rowdata[i] = (rowdata[i] + rowdata[i-1]) % 256 - elif filterByte == 2: - for i in range(1, rowlength): - rowdata[i] = (rowdata[i] + prev_rowdata[i]) % 256 - else: - # unsupported PNG filter - raise PdfReadError("Unsupported PNG filter %r" % filterByte) - prev_rowdata = rowdata - output.write(''.join([chr(x) for x in rowdata[1:]])) - data = output.getvalue() - else: - # unsupported predictor - raise PdfReadError("Unsupported flatedecode predictor %r" % predictor) - return data - decode = staticmethod(decode) - - def encode(data): - return compress(data) - encode = staticmethod(encode) - -class ASCIIHexDecode(object): - def decode(data, decodeParms=None): - retval = "" - char = "" - x = 0 - while True: - c = data[x] - if c == ">": - break - elif c.isspace(): - x += 1 - continue - char += c - if len(char) == 2: - retval += chr(int(char, base=16)) - char = "" - x += 1 - assert char == "" - return retval - decode = staticmethod(decode) - -class ASCII85Decode(object): - def decode(data, decodeParms=None): - retval = "" - group = [] - x = 0 - hitEod = False - # remove all whitespace from data - data = [y for y in data if not (y in ' \n\r\t')] - while not hitEod: - c = data[x] - if len(retval) == 0 and c == "<" and data[x+1] == "~": - x += 2 - continue - #elif c.isspace(): - # x += 1 - # continue - elif c == 'z': - assert len(group) == 0 - retval += '\x00\x00\x00\x00' - continue - elif c == "~" and data[x+1] == ">": - if len(group) != 0: - # cannot have a final group of just 1 char - assert len(group) > 1 - cnt = len(group) - 1 - group += [ 85, 85, 85 ] - hitEod = cnt - else: - break - else: - c = ord(c) - 33 - assert c >= 0 and c < 85 - group += [ c ] - if len(group) >= 5: - b = group[0] * (85**4) + \ - group[1] * (85**3) + \ - group[2] * (85**2) + \ - group[3] * 85 + \ - group[4] - assert b < (2**32 - 1) - c4 = chr((b >> 0) % 256) - c3 = chr((b >> 8) % 256) - c2 = chr((b >> 16) % 256) - c1 = chr(b >> 24) - retval += (c1 + c2 + c3 + c4) - if hitEod: - retval = retval[:-4+hitEod] - group = [] - x += 1 - return retval - decode = staticmethod(decode) - -def decodeStreamData(stream): - from generic import NameObject - filters = stream.get("/Filter", ()) - if len(filters) and not isinstance(filters[0], NameObject): - # we have a single filter instance - filters = (filters,) - data = stream._data - for filterType in filters: - if filterType == "/FlateDecode": - data = FlateDecode.decode(data, stream.get("/DecodeParms")) - elif filterType == "/ASCIIHexDecode": - data = ASCIIHexDecode.decode(data) - elif filterType == "/ASCII85Decode": - data = ASCII85Decode.decode(data) - elif filterType == "/Crypt": - decodeParams = stream.get("/DecodeParams", {}) - if "/Name" not in decodeParams and "/Type" not in decodeParams: - pass - else: - raise NotImplementedError("/Crypt filter with /Name or /Type not supported yet") - else: - # unsupported filter - raise NotImplementedError("unsupported filter %s" % filterType) - return data - -if __name__ == "__main__": - assert "abc" == ASCIIHexDecode.decode('61\n626\n3>') - - ascii85Test = """ - <~9jqo^BlbD-BleB1DJ+*+F(f,q/0JhKFCj@.4Gp$d7F!,L7@<6@)/0JDEF@3BB/F*&OCAfu2/AKY - i(DIb:@FD,*)+C]U=@3BN#EcYf8ATD3s@q?d$AftVqCh[NqF-FD5W8ARlolDIa - l(DIduD.RTpAKYo'+CT/5+Cei#DII?(E,9)oF*2M7/c~> - """ - ascii85_originalText="Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure." - assert ASCII85Decode.decode(ascii85Test) == ascii85_originalText - +# -*- coding: utf-8 -*- +# vim: sw=4:expandtab:foldmethod=marker +# +# Copyright (c) 2006, Mathieu Fenniak +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + + +""" +Implementation of stream filters for PDF. +""" +__author__ = "Mathieu Fenniak" +__author_email__ = "biziqe@mathieu.fenniak.net" + +from utils import PdfReadError +try: + from cStringIO import StringIO +except ImportError: + from StringIO import StringIO + +try: + import zlib + def decompress(data): + return zlib.decompress(data) + def compress(data): + return zlib.compress(data) +except ImportError: + # Unable to import zlib. Attempt to use the System.IO.Compression + # library from the .NET framework. (IronPython only) + import System + from System import IO, Collections, Array + def _string_to_bytearr(buf): + retval = Array.CreateInstance(System.Byte, len(buf)) + for i in range(len(buf)): + retval[i] = ord(buf[i]) + return retval + def _bytearr_to_string(bytes): + retval = "" + for i in range(bytes.Length): + retval += chr(bytes[i]) + return retval + def _read_bytes(stream): + ms = IO.MemoryStream() + buf = Array.CreateInstance(System.Byte, 2048) + while True: + bytes = stream.Read(buf, 0, buf.Length) + if bytes == 0: + break + else: + ms.Write(buf, 0, bytes) + retval = ms.ToArray() + ms.Close() + return retval + def decompress(data): + bytes = _string_to_bytearr(data) + ms = IO.MemoryStream() + ms.Write(bytes, 0, bytes.Length) + ms.Position = 0 # fseek 0 + gz = IO.Compression.DeflateStream(ms, IO.Compression.CompressionMode.Decompress) + bytes = _read_bytes(gz) + retval = _bytearr_to_string(bytes) + gz.Close() + return retval + def compress(data): + bytes = _string_to_bytearr(data) + ms = IO.MemoryStream() + gz = IO.Compression.DeflateStream(ms, IO.Compression.CompressionMode.Compress, True) + gz.Write(bytes, 0, bytes.Length) + gz.Close() + ms.Position = 0 # fseek 0 + bytes = ms.ToArray() + retval = _bytearr_to_string(bytes) + ms.Close() + return retval + + +class FlateDecode(object): + def decode(data, decodeParms): + data = decompress(data) + predictor = 1 + if decodeParms: + predictor = decodeParms.get("/Predictor", 1) + # predictor 1 == no predictor + if predictor != 1: + columns = decodeParms["/Columns"] + # PNG prediction: + if predictor >= 10 and predictor <= 15: + output = StringIO() + # PNG prediction can vary from row to row + rowlength = columns + 1 + assert len(data) % rowlength == 0 + prev_rowdata = (0,) * rowlength + for row in xrange(len(data) / rowlength): + rowdata = [ord(x) for x in data[(row*rowlength):((row+1)*rowlength)]] + filterByte = rowdata[0] + if filterByte == 0: + pass + elif filterByte == 1: + for i in range(2, rowlength): + rowdata[i] = (rowdata[i] + rowdata[i-1]) % 256 + elif filterByte == 2: + for i in range(1, rowlength): + rowdata[i] = (rowdata[i] + prev_rowdata[i]) % 256 + else: + # unsupported PNG filter + raise PdfReadError("Unsupported PNG filter %r" % filterByte) + prev_rowdata = rowdata + output.write(''.join([chr(x) for x in rowdata[1:]])) + data = output.getvalue() + else: + # unsupported predictor + raise PdfReadError("Unsupported flatedecode predictor %r" % predictor) + return data + decode = staticmethod(decode) + + def encode(data): + return compress(data) + encode = staticmethod(encode) + +class ASCIIHexDecode(object): + def decode(data, decodeParms=None): + retval = "" + char = "" + x = 0 + while True: + c = data[x] + if c == ">": + break + elif c.isspace(): + x += 1 + continue + char += c + if len(char) == 2: + retval += chr(int(char, base=16)) + char = "" + x += 1 + assert char == "" + return retval + decode = staticmethod(decode) + +class ASCII85Decode(object): + def decode(data, decodeParms=None): + retval = "" + group = [] + x = 0 + hitEod = False + # remove all whitespace from data + data = [y for y in data if not (y in ' \n\r\t')] + while not hitEod: + c = data[x] + if len(retval) == 0 and c == "<" and data[x+1] == "~": + x += 2 + continue + #elif c.isspace(): + # x += 1 + # continue + elif c == 'z': + assert len(group) == 0 + retval += '\x00\x00\x00\x00' + continue + elif c == "~" and data[x+1] == ">": + if len(group) != 0: + # cannot have a final group of just 1 char + assert len(group) > 1 + cnt = len(group) - 1 + group += [ 85, 85, 85 ] + hitEod = cnt + else: + break + else: + c = ord(c) - 33 + assert c >= 0 and c < 85 + group += [ c ] + if len(group) >= 5: + b = group[0] * (85**4) + \ + group[1] * (85**3) + \ + group[2] * (85**2) + \ + group[3] * 85 + \ + group[4] + assert b < (2**32 - 1) + c4 = chr((b >> 0) % 256) + c3 = chr((b >> 8) % 256) + c2 = chr((b >> 16) % 256) + c1 = chr(b >> 24) + retval += (c1 + c2 + c3 + c4) + if hitEod: + retval = retval[:-4+hitEod] + group = [] + x += 1 + return retval + decode = staticmethod(decode) + +def decodeStreamData(stream): + from generic import NameObject + filters = stream.get("/Filter", ()) + if len(filters) and not isinstance(filters[0], NameObject): + # we have a single filter instance + filters = (filters,) + data = stream._data + for filterType in filters: + if filterType == "/FlateDecode": + data = FlateDecode.decode(data, stream.get("/DecodeParms")) + elif filterType == "/ASCIIHexDecode": + data = ASCIIHexDecode.decode(data) + elif filterType == "/ASCII85Decode": + data = ASCII85Decode.decode(data) + elif filterType == "/Crypt": + decodeParams = stream.get("/DecodeParams", {}) + if "/Name" not in decodeParams and "/Type" not in decodeParams: + pass + else: + raise NotImplementedError("/Crypt filter with /Name or /Type not supported yet") + else: + # unsupported filter + raise NotImplementedError("unsupported filter %s" % filterType) + return data + +if __name__ == "__main__": + assert "abc" == ASCIIHexDecode.decode('61\n626\n3>') + + ascii85Test = """ + <~9jqo^BlbD-BleB1DJ+*+F(f,q/0JhKFCj@.4Gp$d7F!,L7@<6@)/0JDEF@3BB/F*&OCAfu2/AKY + i(DIb:@FD,*)+C]U=@3BN#EcYf8ATD3s@q?d$AftVqCh[NqF-FD5W8ARlolDIa + l(DIduD.RTpAKYo'+CT/5+Cei#DII?(E,9)oF*2M7/c~> + """ + ascii85_originalText="Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure." + assert ASCII85Decode.decode(ascii85Test) == ascii85_originalText + diff --git a/bin/report/pyPdf/generic.py b/bin/report/pyPdf/generic.py index fb75ef3b3fe..ef9d7e186b9 100644 --- a/bin/report/pyPdf/generic.py +++ b/bin/report/pyPdf/generic.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # vim: sw=4:expandtab:foldmethod=marker # # Copyright (c) 2006, Mathieu Fenniak diff --git a/bin/report/pyPdf/pdf.py b/bin/report/pyPdf/pdf.py index ce4331b498a..2963c46eba5 100644 --- a/bin/report/pyPdf/pdf.py +++ b/bin/report/pyPdf/pdf.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # vim: sw=4:expandtab:foldmethod=marker # # Copyright (c) 2006, Mathieu Fenniak diff --git a/bin/report/pyPdf/utils.py b/bin/report/pyPdf/utils.py index dd0a3d002a0..2a778dd0c05 100644 --- a/bin/report/pyPdf/utils.py +++ b/bin/report/pyPdf/utils.py @@ -1,110 +1,111 @@ -# vim: sw=4:expandtab:foldmethod=marker -# -# Copyright (c) 2006, Mathieu Fenniak -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - - -""" -Utility functions for PDF library. -""" -__author__ = "Mathieu Fenniak" -__author_email__ = "biziqe@mathieu.fenniak.net" - -#ENABLE_PSYCO = False -#if ENABLE_PSYCO: -# try: -# import psyco -# except ImportError: -# ENABLE_PSYCO = False -# -#if not ENABLE_PSYCO: -# class psyco: -# def proxy(func): -# return func -# proxy = staticmethod(proxy) - -def readUntilWhitespace(stream, maxchars=None): - txt = "" - while True: - tok = stream.read(1) - if tok.isspace() or not tok: - break - txt += tok - if len(txt) == maxchars: - break - return txt - -def readNonWhitespace(stream): - tok = ' ' - while tok == '\n' or tok == '\r' or tok == ' ' or tok == '\t': - tok = stream.read(1) - return tok - -class ConvertFunctionsToVirtualList(object): - def __init__(self, lengthFunction, getFunction): - self.lengthFunction = lengthFunction - self.getFunction = getFunction - - def __len__(self): - return self.lengthFunction() - - def __getitem__(self, index): - if not isinstance(index, int): - raise TypeError, "sequence indices must be integers" - len_self = len(self) - if index < 0: - # support negative indexes - index = len_self + index - if index < 0 or index >= len_self: - raise IndexError, "sequence index out of range" - return self.getFunction(index) - -def RC4_encrypt(key, plaintext): - S = [i for i in range(256)] - j = 0 - for i in range(256): - j = (j + S[i] + ord(key[i % len(key)])) % 256 - S[i], S[j] = S[j], S[i] - i, j = 0, 0 - retval = "" - for x in range(len(plaintext)): - i = (i + 1) % 256 - j = (j + S[i]) % 256 - S[i], S[j] = S[j], S[i] - t = S[(S[i] + S[j]) % 256] - retval += chr(ord(plaintext[x]) ^ t) - return retval - -class PdfReadError(Exception): - pass - -if __name__ == "__main__": - # test RC4 - out = RC4_encrypt("Key", "Plaintext") - print repr(out) - pt = RC4_encrypt("Key", out) - print repr(pt) +# -*- coding: utf-8 -*- +# vim: sw=4:expandtab:foldmethod=marker +# +# Copyright (c) 2006, Mathieu Fenniak +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + + +""" +Utility functions for PDF library. +""" +__author__ = "Mathieu Fenniak" +__author_email__ = "biziqe@mathieu.fenniak.net" + +#ENABLE_PSYCO = False +#if ENABLE_PSYCO: +# try: +# import psyco +# except ImportError: +# ENABLE_PSYCO = False +# +#if not ENABLE_PSYCO: +# class psyco: +# def proxy(func): +# return func +# proxy = staticmethod(proxy) + +def readUntilWhitespace(stream, maxchars=None): + txt = "" + while True: + tok = stream.read(1) + if tok.isspace() or not tok: + break + txt += tok + if len(txt) == maxchars: + break + return txt + +def readNonWhitespace(stream): + tok = ' ' + while tok == '\n' or tok == '\r' or tok == ' ' or tok == '\t': + tok = stream.read(1) + return tok + +class ConvertFunctionsToVirtualList(object): + def __init__(self, lengthFunction, getFunction): + self.lengthFunction = lengthFunction + self.getFunction = getFunction + + def __len__(self): + return self.lengthFunction() + + def __getitem__(self, index): + if not isinstance(index, int): + raise TypeError, "sequence indices must be integers" + len_self = len(self) + if index < 0: + # support negative indexes + index = len_self + index + if index < 0 or index >= len_self: + raise IndexError, "sequence index out of range" + return self.getFunction(index) + +def RC4_encrypt(key, plaintext): + S = [i for i in range(256)] + j = 0 + for i in range(256): + j = (j + S[i] + ord(key[i % len(key)])) % 256 + S[i], S[j] = S[j], S[i] + i, j = 0, 0 + retval = "" + for x in range(len(plaintext)): + i = (i + 1) % 256 + j = (j + S[i]) % 256 + S[i], S[j] = S[j], S[i] + t = S[(S[i] + S[j]) % 256] + retval += chr(ord(plaintext[x]) ^ t) + return retval + +class PdfReadError(Exception): + pass + +if __name__ == "__main__": + # test RC4 + out = RC4_encrypt("Key", "Plaintext") + print repr(out) + pt = RC4_encrypt("Key", out) + print repr(pt) diff --git a/bin/report/pyPdf/xmp.py b/bin/report/pyPdf/xmp.py index b070df9093e..5018b7825ed 100644 --- a/bin/report/pyPdf/xmp.py +++ b/bin/report/pyPdf/xmp.py @@ -1,355 +1,356 @@ -import re -import datetime -import decimal -from generic import PdfObject -from xml.dom import getDOMImplementation -from xml.dom.minidom import parseString - -RDF_NAMESPACE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" -DC_NAMESPACE = "http://purl.org/dc/elements/1.1/" -XMP_NAMESPACE = "http://ns.adobe.com/xap/1.0/" -PDF_NAMESPACE = "http://ns.adobe.com/pdf/1.3/" -XMPMM_NAMESPACE = "http://ns.adobe.com/xap/1.0/mm/" - -# What is the PDFX namespace, you might ask? I might ask that too. It's -# a completely undocumented namespace used to place "custom metadata" -# properties, which are arbitrary metadata properties with no semantic or -# documented meaning. Elements in the namespace are key/value-style storage, -# where the element name is the key and the content is the value. The keys -# are transformed into valid XML identifiers by substituting an invalid -# identifier character with \u2182 followed by the unicode hex ID of the -# original character. A key like "my car" is therefore "my\u21820020car". -# -# \u2182, in case you're wondering, is the unicode character -# \u{ROMAN NUMERAL TEN THOUSAND}, a straightforward and obvious choice for -# escaping characters. -# -# Intentional users of the pdfx namespace should be shot on sight. A -# custom data schema and sensical XML elements could be used instead, as is -# suggested by Adobe's own documentation on XMP (under "Extensibility of -# Schemas"). -# -# Information presented here on the /pdfx/ schema is a result of limited -# reverse engineering, and does not constitute a full specification. -PDFX_NAMESPACE = "http://ns.adobe.com/pdfx/1.3/" - -iso8601 = re.compile(""" - (?P[0-9]{4}) - (- - (?P[0-9]{2}) - (- - (?P[0-9]+) - (T - (?P[0-9]{2}): - (?P[0-9]{2}) - (:(?P[0-9]{2}(.[0-9]+)?))? - (?PZ|[-+][0-9]{2}:[0-9]{2}) - )? - )? - )? - """, re.VERBOSE) - -## -# An object that represents Adobe XMP metadata. -class XmpInformation(PdfObject): - - def __init__(self, stream): - self.stream = stream - docRoot = parseString(self.stream.getData()) - self.rdfRoot = docRoot.getElementsByTagNameNS(RDF_NAMESPACE, "RDF")[0] - self.cache = {} - - def writeToStream(self, stream, encryption_key): - self.stream.writeToStream(stream, encryption_key) - - def getElement(self, aboutUri, namespace, name): - for desc in self.rdfRoot.getElementsByTagNameNS(RDF_NAMESPACE, "Description"): - if desc.getAttributeNS(RDF_NAMESPACE, "about") == aboutUri: - attr = desc.getAttributeNodeNS(namespace, name) - if attr != None: - yield attr - for element in desc.getElementsByTagNameNS(namespace, name): - yield element - - def getNodesInNamespace(self, aboutUri, namespace): - for desc in self.rdfRoot.getElementsByTagNameNS(RDF_NAMESPACE, "Description"): - if desc.getAttributeNS(RDF_NAMESPACE, "about") == aboutUri: - for i in range(desc.attributes.length): - attr = desc.attributes.item(i) - if attr.namespaceURI == namespace: - yield attr - for child in desc.childNodes: - if child.namespaceURI == namespace: - yield child - - def _getText(self, element): - text = "" - for child in element.childNodes: - if child.nodeType == child.TEXT_NODE: - text += child.data - return text - - def _converter_string(value): - return value - - def _converter_date(value): - m = iso8601.match(value) - year = int(m.group("year")) - month = int(m.group("month") or "1") - day = int(m.group("day") or "1") - hour = int(m.group("hour") or "0") - minute = int(m.group("minute") or "0") - second = decimal.Decimal(m.group("second") or "0") - seconds = second.to_integral(decimal.ROUND_FLOOR) - milliseconds = (second - seconds) * 1000000 - tzd = m.group("tzd") or "Z" - dt = datetime.datetime(year, month, day, hour, minute, seconds, milliseconds) - if tzd != "Z": - tzd_hours, tzd_minutes = [int(x) for x in tzd.split(":")] - tzd_hours *= -1 - if tzd_hours < 0: - tzd_minutes *= -1 - dt = dt + datetime.timedelta(hours=tzd_hours, minutes=tzd_minutes) - return dt - _test_converter_date = staticmethod(_converter_date) - - def _getter_bag(namespace, name, converter): - def get(self): - cached = self.cache.get(namespace, {}).get(name) - if cached: - return cached - retval = [] - for element in self.getElement("", namespace, name): - bags = element.getElementsByTagNameNS(RDF_NAMESPACE, "Bag") - if len(bags): - for bag in bags: - for item in bag.getElementsByTagNameNS(RDF_NAMESPACE, "li"): - value = self._getText(item) - value = converter(value) - retval.append(value) - ns_cache = self.cache.setdefault(namespace, {}) - ns_cache[name] = retval - return retval - return get - - def _getter_seq(namespace, name, converter): - def get(self): - cached = self.cache.get(namespace, {}).get(name) - if cached: - return cached - retval = [] - for element in self.getElement("", namespace, name): - seqs = element.getElementsByTagNameNS(RDF_NAMESPACE, "Seq") - if len(seqs): - for seq in seqs: - for item in seq.getElementsByTagNameNS(RDF_NAMESPACE, "li"): - value = self._getText(item) - value = converter(value) - retval.append(value) - else: - value = converter(self._getText(element)) - retval.append(value) - ns_cache = self.cache.setdefault(namespace, {}) - ns_cache[name] = retval - return retval - return get - - def _getter_langalt(namespace, name, converter): - def get(self): - cached = self.cache.get(namespace, {}).get(name) - if cached: - return cached - retval = {} - for element in self.getElement("", namespace, name): - alts = element.getElementsByTagNameNS(RDF_NAMESPACE, "Alt") - if len(alts): - for alt in alts: - for item in alt.getElementsByTagNameNS(RDF_NAMESPACE, "li"): - value = self._getText(item) - value = converter(value) - retval[item.getAttribute("xml:lang")] = value - else: - retval["x-default"] = converter(self._getText(element)) - ns_cache = self.cache.setdefault(namespace, {}) - ns_cache[name] = retval - return retval - return get - - def _getter_single(namespace, name, converter): - def get(self): - cached = self.cache.get(namespace, {}).get(name) - if cached: - return cached - value = None - for element in self.getElement("", namespace, name): - if element.nodeType == element.ATTRIBUTE_NODE: - value = element.nodeValue - else: - value = self._getText(element) - break - if value != None: - value = converter(value) - ns_cache = self.cache.setdefault(namespace, {}) - ns_cache[name] = value - return value - return get - - ## - # Contributors to the resource (other than the authors). An unsorted - # array of names. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_contributor = property(_getter_bag(DC_NAMESPACE, "contributor", _converter_string)) - - ## - # Text describing the extent or scope of the resource. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_coverage = property(_getter_single(DC_NAMESPACE, "coverage", _converter_string)) - - ## - # A sorted array of names of the authors of the resource, listed in order - # of precedence. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_creator = property(_getter_seq(DC_NAMESPACE, "creator", _converter_string)) - - ## - # A sorted array of dates (datetime.datetime instances) of signifigance to - # the resource. The dates and times are in UTC. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_date = property(_getter_seq(DC_NAMESPACE, "date", _converter_date)) - - ## - # A language-keyed dictionary of textual descriptions of the content of the - # resource. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_description = property(_getter_langalt(DC_NAMESPACE, "description", _converter_string)) - - ## - # The mime-type of the resource. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_format = property(_getter_single(DC_NAMESPACE, "format", _converter_string)) - - ## - # Unique identifier of the resource. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_identifier = property(_getter_single(DC_NAMESPACE, "identifier", _converter_string)) - - ## - # An unordered array specifying the languages used in the resource. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_language = property(_getter_bag(DC_NAMESPACE, "language", _converter_string)) - - ## - # An unordered array of publisher names. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_publisher = property(_getter_bag(DC_NAMESPACE, "publisher", _converter_string)) - - ## - # An unordered array of text descriptions of relationships to other - # documents. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_relation = property(_getter_bag(DC_NAMESPACE, "relation", _converter_string)) - - ## - # A language-keyed dictionary of textual descriptions of the rights the - # user has to this resource. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_rights = property(_getter_langalt(DC_NAMESPACE, "rights", _converter_string)) - - ## - # Unique identifier of the work from which this resource was derived. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_source = property(_getter_single(DC_NAMESPACE, "source", _converter_string)) - - ## - # An unordered array of descriptive phrases or keywrods that specify the - # topic of the content of the resource. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_subject = property(_getter_bag(DC_NAMESPACE, "subject", _converter_string)) - - ## - # A language-keyed dictionary of the title of the resource. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_title = property(_getter_langalt(DC_NAMESPACE, "title", _converter_string)) - - ## - # An unordered array of textual descriptions of the document type. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - dc_type = property(_getter_bag(DC_NAMESPACE, "type", _converter_string)) - - ## - # An unformatted text string representing document keywords. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - pdf_keywords = property(_getter_single(PDF_NAMESPACE, "Keywords", _converter_string)) - - ## - # The PDF file version, for example 1.0, 1.3. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - pdf_pdfversion = property(_getter_single(PDF_NAMESPACE, "PDFVersion", _converter_string)) - - ## - # The name of the tool that created the PDF document. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - pdf_producer = property(_getter_single(PDF_NAMESPACE, "Producer", _converter_string)) - - ## - # The date and time the resource was originally created. The date and - # time are returned as a UTC datetime.datetime object. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - xmp_createDate = property(_getter_single(XMP_NAMESPACE, "CreateDate", _converter_date)) - - ## - # The date and time the resource was last modified. The date and time - # are returned as a UTC datetime.datetime object. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - xmp_modifyDate = property(_getter_single(XMP_NAMESPACE, "ModifyDate", _converter_date)) - - ## - # The date and time that any metadata for this resource was last - # changed. The date and time are returned as a UTC datetime.datetime - # object. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - xmp_metadataDate = property(_getter_single(XMP_NAMESPACE, "MetadataDate", _converter_date)) - - ## - # The name of the first known tool used to create the resource. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - xmp_creatorTool = property(_getter_single(XMP_NAMESPACE, "CreatorTool", _converter_string)) - - ## - # The common identifier for all versions and renditions of this resource. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - xmpmm_documentId = property(_getter_single(XMPMM_NAMESPACE, "DocumentID", _converter_string)) - - ## - # An identifier for a specific incarnation of a document, updated each - # time a file is saved. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - xmpmm_instanceId = property(_getter_single(XMPMM_NAMESPACE, "InstanceID", _converter_string)) - - def custom_properties(self): - if not hasattr(self, "_custom_properties"): - self._custom_properties = {} - for node in self.getNodesInNamespace("", PDFX_NAMESPACE): - key = node.localName - while True: - # see documentation about PDFX_NAMESPACE earlier in file - idx = key.find(u"\u2182") - if idx == -1: - break - key = key[:idx] + chr(int(key[idx+1:idx+5], base=16)) + key[idx+5:] - if node.nodeType == node.ATTRIBUTE_NODE: - value = node.nodeValue - else: - value = self._getText(node) - self._custom_properties[key] = value - return self._custom_properties - - ## - # Retrieves custom metadata properties defined in the undocumented pdfx - # metadata schema. - #

Stability: Added in v1.12, will exist for all future v1.x releases. - # @return Returns a dictionary of key/value items for custom metadata - # properties. - custom_properties = property(custom_properties) - - +# -*- coding: utf-8 -*- +import re +import datetime +import decimal +from generic import PdfObject +from xml.dom import getDOMImplementation +from xml.dom.minidom import parseString + +RDF_NAMESPACE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" +DC_NAMESPACE = "http://purl.org/dc/elements/1.1/" +XMP_NAMESPACE = "http://ns.adobe.com/xap/1.0/" +PDF_NAMESPACE = "http://ns.adobe.com/pdf/1.3/" +XMPMM_NAMESPACE = "http://ns.adobe.com/xap/1.0/mm/" + +# What is the PDFX namespace, you might ask? I might ask that too. It's +# a completely undocumented namespace used to place "custom metadata" +# properties, which are arbitrary metadata properties with no semantic or +# documented meaning. Elements in the namespace are key/value-style storage, +# where the element name is the key and the content is the value. The keys +# are transformed into valid XML identifiers by substituting an invalid +# identifier character with \u2182 followed by the unicode hex ID of the +# original character. A key like "my car" is therefore "my\u21820020car". +# +# \u2182, in case you're wondering, is the unicode character +# \u{ROMAN NUMERAL TEN THOUSAND}, a straightforward and obvious choice for +# escaping characters. +# +# Intentional users of the pdfx namespace should be shot on sight. A +# custom data schema and sensical XML elements could be used instead, as is +# suggested by Adobe's own documentation on XMP (under "Extensibility of +# Schemas"). +# +# Information presented here on the /pdfx/ schema is a result of limited +# reverse engineering, and does not constitute a full specification. +PDFX_NAMESPACE = "http://ns.adobe.com/pdfx/1.3/" + +iso8601 = re.compile(""" + (?P[0-9]{4}) + (- + (?P[0-9]{2}) + (- + (?P[0-9]+) + (T + (?P[0-9]{2}): + (?P[0-9]{2}) + (:(?P[0-9]{2}(.[0-9]+)?))? + (?PZ|[-+][0-9]{2}:[0-9]{2}) + )? + )? + )? + """, re.VERBOSE) + +## +# An object that represents Adobe XMP metadata. +class XmpInformation(PdfObject): + + def __init__(self, stream): + self.stream = stream + docRoot = parseString(self.stream.getData()) + self.rdfRoot = docRoot.getElementsByTagNameNS(RDF_NAMESPACE, "RDF")[0] + self.cache = {} + + def writeToStream(self, stream, encryption_key): + self.stream.writeToStream(stream, encryption_key) + + def getElement(self, aboutUri, namespace, name): + for desc in self.rdfRoot.getElementsByTagNameNS(RDF_NAMESPACE, "Description"): + if desc.getAttributeNS(RDF_NAMESPACE, "about") == aboutUri: + attr = desc.getAttributeNodeNS(namespace, name) + if attr != None: + yield attr + for element in desc.getElementsByTagNameNS(namespace, name): + yield element + + def getNodesInNamespace(self, aboutUri, namespace): + for desc in self.rdfRoot.getElementsByTagNameNS(RDF_NAMESPACE, "Description"): + if desc.getAttributeNS(RDF_NAMESPACE, "about") == aboutUri: + for i in range(desc.attributes.length): + attr = desc.attributes.item(i) + if attr.namespaceURI == namespace: + yield attr + for child in desc.childNodes: + if child.namespaceURI == namespace: + yield child + + def _getText(self, element): + text = "" + for child in element.childNodes: + if child.nodeType == child.TEXT_NODE: + text += child.data + return text + + def _converter_string(value): + return value + + def _converter_date(value): + m = iso8601.match(value) + year = int(m.group("year")) + month = int(m.group("month") or "1") + day = int(m.group("day") or "1") + hour = int(m.group("hour") or "0") + minute = int(m.group("minute") or "0") + second = decimal.Decimal(m.group("second") or "0") + seconds = second.to_integral(decimal.ROUND_FLOOR) + milliseconds = (second - seconds) * 1000000 + tzd = m.group("tzd") or "Z" + dt = datetime.datetime(year, month, day, hour, minute, seconds, milliseconds) + if tzd != "Z": + tzd_hours, tzd_minutes = [int(x) for x in tzd.split(":")] + tzd_hours *= -1 + if tzd_hours < 0: + tzd_minutes *= -1 + dt = dt + datetime.timedelta(hours=tzd_hours, minutes=tzd_minutes) + return dt + _test_converter_date = staticmethod(_converter_date) + + def _getter_bag(namespace, name, converter): + def get(self): + cached = self.cache.get(namespace, {}).get(name) + if cached: + return cached + retval = [] + for element in self.getElement("", namespace, name): + bags = element.getElementsByTagNameNS(RDF_NAMESPACE, "Bag") + if len(bags): + for bag in bags: + for item in bag.getElementsByTagNameNS(RDF_NAMESPACE, "li"): + value = self._getText(item) + value = converter(value) + retval.append(value) + ns_cache = self.cache.setdefault(namespace, {}) + ns_cache[name] = retval + return retval + return get + + def _getter_seq(namespace, name, converter): + def get(self): + cached = self.cache.get(namespace, {}).get(name) + if cached: + return cached + retval = [] + for element in self.getElement("", namespace, name): + seqs = element.getElementsByTagNameNS(RDF_NAMESPACE, "Seq") + if len(seqs): + for seq in seqs: + for item in seq.getElementsByTagNameNS(RDF_NAMESPACE, "li"): + value = self._getText(item) + value = converter(value) + retval.append(value) + else: + value = converter(self._getText(element)) + retval.append(value) + ns_cache = self.cache.setdefault(namespace, {}) + ns_cache[name] = retval + return retval + return get + + def _getter_langalt(namespace, name, converter): + def get(self): + cached = self.cache.get(namespace, {}).get(name) + if cached: + return cached + retval = {} + for element in self.getElement("", namespace, name): + alts = element.getElementsByTagNameNS(RDF_NAMESPACE, "Alt") + if len(alts): + for alt in alts: + for item in alt.getElementsByTagNameNS(RDF_NAMESPACE, "li"): + value = self._getText(item) + value = converter(value) + retval[item.getAttribute("xml:lang")] = value + else: + retval["x-default"] = converter(self._getText(element)) + ns_cache = self.cache.setdefault(namespace, {}) + ns_cache[name] = retval + return retval + return get + + def _getter_single(namespace, name, converter): + def get(self): + cached = self.cache.get(namespace, {}).get(name) + if cached: + return cached + value = None + for element in self.getElement("", namespace, name): + if element.nodeType == element.ATTRIBUTE_NODE: + value = element.nodeValue + else: + value = self._getText(element) + break + if value != None: + value = converter(value) + ns_cache = self.cache.setdefault(namespace, {}) + ns_cache[name] = value + return value + return get + + ## + # Contributors to the resource (other than the authors). An unsorted + # array of names. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_contributor = property(_getter_bag(DC_NAMESPACE, "contributor", _converter_string)) + + ## + # Text describing the extent or scope of the resource. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_coverage = property(_getter_single(DC_NAMESPACE, "coverage", _converter_string)) + + ## + # A sorted array of names of the authors of the resource, listed in order + # of precedence. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_creator = property(_getter_seq(DC_NAMESPACE, "creator", _converter_string)) + + ## + # A sorted array of dates (datetime.datetime instances) of signifigance to + # the resource. The dates and times are in UTC. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_date = property(_getter_seq(DC_NAMESPACE, "date", _converter_date)) + + ## + # A language-keyed dictionary of textual descriptions of the content of the + # resource. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_description = property(_getter_langalt(DC_NAMESPACE, "description", _converter_string)) + + ## + # The mime-type of the resource. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_format = property(_getter_single(DC_NAMESPACE, "format", _converter_string)) + + ## + # Unique identifier of the resource. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_identifier = property(_getter_single(DC_NAMESPACE, "identifier", _converter_string)) + + ## + # An unordered array specifying the languages used in the resource. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_language = property(_getter_bag(DC_NAMESPACE, "language", _converter_string)) + + ## + # An unordered array of publisher names. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_publisher = property(_getter_bag(DC_NAMESPACE, "publisher", _converter_string)) + + ## + # An unordered array of text descriptions of relationships to other + # documents. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_relation = property(_getter_bag(DC_NAMESPACE, "relation", _converter_string)) + + ## + # A language-keyed dictionary of textual descriptions of the rights the + # user has to this resource. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_rights = property(_getter_langalt(DC_NAMESPACE, "rights", _converter_string)) + + ## + # Unique identifier of the work from which this resource was derived. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_source = property(_getter_single(DC_NAMESPACE, "source", _converter_string)) + + ## + # An unordered array of descriptive phrases or keywrods that specify the + # topic of the content of the resource. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_subject = property(_getter_bag(DC_NAMESPACE, "subject", _converter_string)) + + ## + # A language-keyed dictionary of the title of the resource. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_title = property(_getter_langalt(DC_NAMESPACE, "title", _converter_string)) + + ## + # An unordered array of textual descriptions of the document type. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + dc_type = property(_getter_bag(DC_NAMESPACE, "type", _converter_string)) + + ## + # An unformatted text string representing document keywords. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + pdf_keywords = property(_getter_single(PDF_NAMESPACE, "Keywords", _converter_string)) + + ## + # The PDF file version, for example 1.0, 1.3. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + pdf_pdfversion = property(_getter_single(PDF_NAMESPACE, "PDFVersion", _converter_string)) + + ## + # The name of the tool that created the PDF document. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + pdf_producer = property(_getter_single(PDF_NAMESPACE, "Producer", _converter_string)) + + ## + # The date and time the resource was originally created. The date and + # time are returned as a UTC datetime.datetime object. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + xmp_createDate = property(_getter_single(XMP_NAMESPACE, "CreateDate", _converter_date)) + + ## + # The date and time the resource was last modified. The date and time + # are returned as a UTC datetime.datetime object. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + xmp_modifyDate = property(_getter_single(XMP_NAMESPACE, "ModifyDate", _converter_date)) + + ## + # The date and time that any metadata for this resource was last + # changed. The date and time are returned as a UTC datetime.datetime + # object. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + xmp_metadataDate = property(_getter_single(XMP_NAMESPACE, "MetadataDate", _converter_date)) + + ## + # The name of the first known tool used to create the resource. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + xmp_creatorTool = property(_getter_single(XMP_NAMESPACE, "CreatorTool", _converter_string)) + + ## + # The common identifier for all versions and renditions of this resource. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + xmpmm_documentId = property(_getter_single(XMPMM_NAMESPACE, "DocumentID", _converter_string)) + + ## + # An identifier for a specific incarnation of a document, updated each + # time a file is saved. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + xmpmm_instanceId = property(_getter_single(XMPMM_NAMESPACE, "InstanceID", _converter_string)) + + def custom_properties(self): + if not hasattr(self, "_custom_properties"): + self._custom_properties = {} + for node in self.getNodesInNamespace("", PDFX_NAMESPACE): + key = node.localName + while True: + # see documentation about PDFX_NAMESPACE earlier in file + idx = key.find(u"\u2182") + if idx == -1: + break + key = key[:idx] + chr(int(key[idx+1:idx+5], base=16)) + key[idx+5:] + if node.nodeType == node.ATTRIBUTE_NODE: + value = node.nodeValue + else: + value = self._getText(node) + self._custom_properties[key] = value + return self._custom_properties + + ## + # Retrieves custom metadata properties defined in the undocumented pdfx + # metadata schema. + #

Stability: Added in v1.12, will exist for all future v1.x releases. + # @return Returns a dictionary of key/value items for custom metadata + # properties. + custom_properties = property(custom_properties) + + diff --git a/bin/report/render/__init__.py b/bin/report/render/__init__.py index 659daee81e2..cbc8fab0c9e 100644 --- a/bin/report/render/__init__.py +++ b/bin/report/render/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/html2html/__init__.py b/bin/report/render/html2html/__init__.py index fab26bcec1c..bb497aca94f 100644 --- a/bin/report/render/html2html/__init__.py +++ b/bin/report/render/html2html/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/html2html/html2html.py b/bin/report/render/html2html/html2html.py index d84c8492adc..9acb25b5d28 100644 --- a/bin/report/render/html2html/html2html.py +++ b/bin/report/render/html2html/html2html.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/odt2odt/__init__.py b/bin/report/render/odt2odt/__init__.py index 5d7703b4f86..3ab97b95ed5 100644 --- a/bin/report/render/odt2odt/__init__.py +++ b/bin/report/render/odt2odt/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/odt2odt/odt2odt.py b/bin/report/render/odt2odt/odt2odt.py index 3add886a862..5df5472e262 100644 --- a/bin/report/render/odt2odt/odt2odt.py +++ b/bin/report/render/odt2odt/odt2odt.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/render.py b/bin/report/render/render.py index c8ddf26c093..5252288d53d 100644 --- a/bin/report/render/render.py +++ b/bin/report/render/render.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/rml.py b/bin/report/render/rml.py index 7cc1cd58ce4..288cbc704c8 100644 --- a/bin/report/render/rml.py +++ b/bin/report/render/rml.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/rml2html/__init__.py b/bin/report/render/rml2html/__init__.py index e88221b5651..52c52863008 100644 --- a/bin/report/render/rml2html/__init__.py +++ b/bin/report/render/rml2html/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/rml2html/rml2html.py b/bin/report/render/rml2html/rml2html.py index 1166c6ec19e..b70c87b7f01 100644 --- a/bin/report/render/rml2html/rml2html.py +++ b/bin/report/render/rml2html/rml2html.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/rml2html/utils.py b/bin/report/render/rml2html/utils.py index 073d9d00204..9d1d15da14c 100644 --- a/bin/report/render/rml2html/utils.py +++ b/bin/report/render/rml2html/utils.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/rml2pdf/__init__.py b/bin/report/render/rml2pdf/__init__.py index 11befbb92c5..001aea413fd 100644 --- a/bin/report/render/rml2pdf/__init__.py +++ b/bin/report/render/rml2pdf/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/rml2pdf/color.py b/bin/report/render/rml2pdf/color.py index ab5388ebeec..69ef56003b1 100644 --- a/bin/report/render/rml2pdf/color.py +++ b/bin/report/render/rml2pdf/color.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/rml2pdf/trml2pdf.py b/bin/report/render/rml2pdf/trml2pdf.py index f398a5b7e45..0b50cab80cc 100644 --- a/bin/report/render/rml2pdf/trml2pdf.py +++ b/bin/report/render/rml2pdf/trml2pdf.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/rml2pdf/utils.py b/bin/report/render/rml2pdf/utils.py index 096e6623aa2..4d3f5ab0fb3 100644 --- a/bin/report/render/rml2pdf/utils.py +++ b/bin/report/render/rml2pdf/utils.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/render/simple.py b/bin/report/render/simple.py index 65daceac872..dd1d4b3ea1f 100644 --- a/bin/report/render/simple.py +++ b/bin/report/render/simple.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py index a67cb8c3c1b..da24d251f0b 100644 --- a/bin/report/report_sxw.py +++ b/bin/report/report_sxw.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/service/__init__.py b/bin/service/__init__.py index 987c1c8a9f4..529acbec628 100644 --- a/bin/service/__init__.py +++ b/bin/service/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/service/security.py b/bin/service/security.py index 0f352e2abe9..3ff9b90a317 100644 --- a/bin/service/security.py +++ b/bin/service/security.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/service/web_services.py b/bin/service/web_services.py index a9aa8917694..95d080c40af 100644 --- a/bin/service/web_services.py +++ b/bin/service/web_services.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/sql_db.py b/bin/sql_db.py index c8ca5c5a671..550ed14555e 100644 --- a/bin/sql_db.py +++ b/bin/sql_db.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tiny_socket.py b/bin/tiny_socket.py index 5b721d5fba6..746d6c22671 100644 --- a/bin/tiny_socket.py +++ b/bin/tiny_socket.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/__init__.py b/bin/tools/__init__.py index b408fbd9986..9b7bb84a57f 100644 --- a/bin/tools/__init__.py +++ b/bin/tools/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/amount_to_text.py b/bin/tools/amount_to_text.py index b8d6d536685..ab81084d39e 100644 --- a/bin/tools/amount_to_text.py +++ b/bin/tools/amount_to_text.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/amount_to_text_en.py b/bin/tools/amount_to_text_en.py index b250f85dfad..69778880738 100644 --- a/bin/tools/amount_to_text_en.py +++ b/bin/tools/amount_to_text_en.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/config.py b/bin/tools/config.py index 06bb7e48804..7085353607f 100644 --- a/bin/tools/config.py +++ b/bin/tools/config.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/convert.py b/bin/tools/convert.py index 99009541b7c..a6c1ce41c58 100644 --- a/bin/tools/convert.py +++ b/bin/tools/convert.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/copy.py b/bin/tools/copy.py index 7c43e8c3ab7..e6583dcfadf 100644 --- a/bin/tools/copy.py +++ b/bin/tools/copy.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/func.py b/bin/tools/func.py index d7c93de630f..3168f5e6935 100644 --- a/bin/tools/func.py +++ b/bin/tools/func.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/graph.py b/bin/tools/graph.py index c60a383c3ac..148b30d396b 100644 --- a/bin/tools/graph.py +++ b/bin/tools/graph.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/import_email.py b/bin/tools/import_email.py index 386bd08ea9f..b597dab5722 100644 --- a/bin/tools/import_email.py +++ b/bin/tools/import_email.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/maintenance.py b/bin/tools/maintenance.py index c4a589a4b06..83cf5e3b8bd 100644 --- a/bin/tools/maintenance.py +++ b/bin/tools/maintenance.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/misc.py b/bin/tools/misc.py index a38da84f62d..038dc9f295e 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/osutil.py b/bin/tools/osutil.py index 1d57a8f7315..51540ae28c7 100644 --- a/bin/tools/osutil.py +++ b/bin/tools/osutil.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/parse_version.py b/bin/tools/parse_version.py index 590967dcd85..c743a9bb239 100644 --- a/bin/tools/parse_version.py +++ b/bin/tools/parse_version.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/pdf_utils.py b/bin/tools/pdf_utils.py index 5716298b26f..4782e544429 100644 --- a/bin/tools/pdf_utils.py +++ b/bin/tools/pdf_utils.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/sql.py b/bin/tools/sql.py index 3cfba7b9038..445eebb0bb8 100644 --- a/bin/tools/sql.py +++ b/bin/tools/sql.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/threadinglocal.py b/bin/tools/threadinglocal.py index e268e874b45..a68181c10e1 100644 --- a/bin/tools/threadinglocal.py +++ b/bin/tools/threadinglocal.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- #Copyright (c) 2004-2005, CherryPy Team (team@cherrypy.org) #All rights reserved. # diff --git a/bin/tools/translate.py b/bin/tools/translate.py index 36c2f9d7427..9f705e42a20 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/tools/win32.py b/bin/tools/win32.py index 562654a4ce2..89651417e6c 100644 --- a/bin/tools/win32.py +++ b/bin/tools/win32.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/wizard/__init__.py b/bin/wizard/__init__.py index 4a64b9dc1d3..c5e34ae3fc0 100644 --- a/bin/wizard/__init__.py +++ b/bin/wizard/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/workflow/__init__.py b/bin/workflow/__init__.py index fabd2c6e37a..50e6181fa5f 100644 --- a/bin/workflow/__init__.py +++ b/bin/workflow/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/workflow/common.py b/bin/workflow/common.py index 91499736b84..fc29419721a 100644 --- a/bin/workflow/common.py +++ b/bin/workflow/common.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/workflow/instance.py b/bin/workflow/instance.py index 96113ab5d5c..204b0f93240 100644 --- a/bin/workflow/instance.py +++ b/bin/workflow/instance.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/workflow/wkf_expr.py b/bin/workflow/wkf_expr.py index c822c994d1b..98896df9324 100644 --- a/bin/workflow/wkf_expr.py +++ b/bin/workflow/wkf_expr.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/workflow/wkf_logs.py b/bin/workflow/wkf_logs.py index b512c0ba735..225f84e86c0 100644 --- a/bin/workflow/wkf_logs.py +++ b/bin/workflow/wkf_logs.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/workflow/wkf_service.py b/bin/workflow/wkf_service.py index 33a7f55ed77..1861fef2913 100644 --- a/bin/workflow/wkf_service.py +++ b/bin/workflow/wkf_service.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/bin/workflow/workitem.py b/bin/workflow/workitem.py index d17809af51c..4576f8c5278 100644 --- a/bin/workflow/workitem.py +++ b/bin/workflow/workitem.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/doc/migrate/3.3.0-3.4.0/post.py b/doc/migrate/3.3.0-3.4.0/post.py index 177d83e972c..bdbd719116b 100644 --- a/doc/migrate/3.3.0-3.4.0/post.py +++ b/doc/migrate/3.3.0-3.4.0/post.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/doc/migrate/3.3.0-3.4.0/pre.py b/doc/migrate/3.3.0-3.4.0/pre.py index a66ad1b1866..db8ec6ddfcc 100644 --- a/doc/migrate/3.3.0-3.4.0/pre.py +++ b/doc/migrate/3.3.0-3.4.0/pre.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/doc/migrate/3.4.0-4.0.0/post-tiny.py b/doc/migrate/3.4.0-4.0.0/post-tiny.py index 40960f4ecb1..f4d299f3763 100644 --- a/doc/migrate/3.4.0-4.0.0/post-tiny.py +++ b/doc/migrate/3.4.0-4.0.0/post-tiny.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/doc/migrate/3.4.0-4.0.0/post.py b/doc/migrate/3.4.0-4.0.0/post.py index 2576f916fb9..2abb06dd6f9 100644 --- a/doc/migrate/3.4.0-4.0.0/post.py +++ b/doc/migrate/3.4.0-4.0.0/post.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/doc/migrate/3.4.0-4.0.0/pre-tiny.py b/doc/migrate/3.4.0-4.0.0/pre-tiny.py index 071c4399887..1001957e719 100644 --- a/doc/migrate/3.4.0-4.0.0/pre-tiny.py +++ b/doc/migrate/3.4.0-4.0.0/pre-tiny.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/doc/migrate/3.4.0-4.0.0/pre.py b/doc/migrate/3.4.0-4.0.0/pre.py index 655598509bd..3e9f2bbf2d4 100644 --- a/doc/migrate/3.4.0-4.0.0/pre.py +++ b/doc/migrate/3.4.0-4.0.0/pre.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/doc/migrate/4.0.0-4.2.0/pre.py b/doc/migrate/4.0.0-4.2.0/pre.py index 25ee78755a0..a8080ee9a2a 100644 --- a/doc/migrate/4.0.0-4.2.0/pre.py +++ b/doc/migrate/4.0.0-4.2.0/pre.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/doc/migrate/4.0.0-4.2.0/tiny/pre-tiny.py b/doc/migrate/4.0.0-4.2.0/tiny/pre-tiny.py index ded5d3dae6c..f2485a24100 100644 --- a/doc/migrate/4.0.0-4.2.0/tiny/pre-tiny.py +++ b/doc/migrate/4.0.0-4.2.0/tiny/pre-tiny.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/doc/migrate/4.2.0-4.4.0/pre.py b/doc/migrate/4.2.0-4.4.0/pre.py index a71e68dc998..5c4598274e5 100644 --- a/doc/migrate/4.2.0-4.4.0/pre.py +++ b/doc/migrate/4.2.0-4.4.0/pre.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/doc/tests/check_profile_l10n_all.py b/doc/tests/check_profile_l10n_all.py index 267e62a97a9..ffde262bf58 100644 --- a/doc/tests/check_profile_l10n_all.py +++ b/doc/tests/check_profile_l10n_all.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/setup.py b/setup.py index 9ab22849417..24398a8dcbf 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/win32/OpenERPServerService.py b/win32/OpenERPServerService.py index 2aee3fb2184..e44a9d274a1 100644 --- a/win32/OpenERPServerService.py +++ b/win32/OpenERPServerService.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution diff --git a/win32/setup.py b/win32/setup.py index 35486313613..0abf94a9a50 100644 --- a/win32/setup.py +++ b/win32/setup.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution