Skip to content

Commit

Permalink
Merge branch master into plone6
Browse files Browse the repository at this point in the history
  • Loading branch information
duchenean committed May 28, 2024
2 parents 1e9d7da + d7b3cc1 commit 251045c
Show file tree
Hide file tree
Showing 20 changed files with 88 additions and 243 deletions.
27 changes: 25 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
Changelog
=========

3.41 (unreleased)
3.44 (unreleased)
-----------------

- Nothing changed yet.


3.43 (2024-04-10)
-----------------

- Import `safe_encode` from `imio.pyutils` instead `imio.helpers`.
[gbastien]
- Use has Plone versions constants (`HAS_PLONE_4`, `HAS_PLONE_5`, ...)
from `imio.helpers`.
[gbastien]

3.42 (2024-02-12)
-----------------

- Translated again type icon title.
[gbastien]

3.41 (2024-02-12)
-----------------

- Corrected typo.
[sgeulette]
- In `TitleColumn`, use `typeInfo.Title()` instead translating `typeInfo.title`,
`Title()` do the same but manages special characters in the `title`.
[gbastien]

3.40 (2023-08-01)
-----------------

- Add `DOCUMENTGENERATOR_LOG_PARAMETERS` environment variable that can be used to log request form parameters with
collective.fingerpointing.
[mpeeters]


3.39 (2023-06-26)
-----------------

Expand Down
189 changes: 0 additions & 189 deletions bootstrap.py

This file was deleted.

12 changes: 12 additions & 0 deletions buildout.d/plone-4.3.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

[buildout]
extends =
https://raw.github.com/collective/buildout.plonetest/master/test-4.3.x.cfg
development.cfg

[versions]
beautifulsoup4 = 4.9.3
soupsieve = 1.9.2
backports.functools-lru-cache = 1.5
zc.lockfile = 2.0
zope.configuration = 3.8.1
2 changes: 2 additions & 0 deletions development.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ auto-checkout +=
collective.behavior.talcondition
collective.big.bang
imio.helpers
imio.pyutils

[instance]
eggs +=
Expand Down Expand Up @@ -54,6 +55,7 @@ collective.big.bang = git ${remotes:collective}/collective.big.bang.git pushurl=
collective.behavior.talcondition = git ${remotes:collective}/collective.behavior.talcondition.git pushurl=${remotes:collective_push}/collective.behavior.talcondition.git
collective.excelexport = git ${remotes:collective}/collective.excelexport.git pushurl=${remotes:collective_push}/collective.excelexport.git
imio.helpers = git ${remotes:imio}/imio.helpers.git pushurl=${remotes:imio_push}/imio.helpers.git
imio.pyutils = git ${remotes:imio}/imio.pyutils.git pushurl=${remotes:imio_push}/imio.pyutils.git
appy = git ${remotes:imio}/appy.git pushurl=${remotes:imio_push}/appy.git

[omelette]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='collective.documentgenerator',
version='3.41.dev0',
version='3.44.dev0',
description="Desktop document generation (.odt, .pdf, .doc, ...) based on appy framework (https://appyframe.work/tool/public) and OpenOffice/LibreOffice",
long_description=long_description,
# Get more from https://pypi.org/pypi?%3Aaction=list_classifiers
Expand Down
17 changes: 9 additions & 8 deletions src/collective/documentgenerator/browser/generation_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
import mimetypes
import os
import unicodedata

import pkg_resources
import six
from AccessControl import Unauthorized
from appy.pod.renderer import CsvOptions, Renderer
from appy.pod.styles_manager import TableProperties
from collective.documentgenerator import config
from collective.documentgenerator import utils
from collective.documentgenerator.content.pod_template import IPODTemplate
from collective.documentgenerator.interfaces import CyclicMergeTemplatesException
from collective.documentgenerator.interfaces import IDocumentFactory
from collective.documentgenerator.interfaces import PODTemplateNotFoundError
from collective.documentgenerator.utils import remove_tmp_file
from collective.documentgenerator.utils import temporary_file_name
from imio.helpers import HAS_PLONE_5_AND_MORE
from plone import api
from plone.app.uuid.utils import uuidToObject
from plone.i18n.normalizer.interfaces import IFileNameNormalizer
Expand All @@ -17,13 +25,6 @@
from six import StringIO
from zope.annotation.interfaces import IAnnotations
from zope.component import getMultiAdapter, queryAdapter, queryUtility

from collective.documentgenerator import config, utils
from collective.documentgenerator.content.pod_template import IPODTemplate
from collective.documentgenerator.interfaces import (
CyclicMergeTemplatesException, IDocumentFactory, PODTemplateNotFoundError)
from collective.documentgenerator.utils import remove_tmp_file
from collective.documentgenerator.utils import temporary_file_name
import io
from .. import _

Expand Down
3 changes: 1 addition & 2 deletions src/collective/documentgenerator/browser/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ def _icons(self, item):
# we assume that stored icon_expr is like string:${portal_url}/myContentIcon.svg
# or like string:${portal_url}/++resource++imio.dashboard/dashboardpodtemplate.svg
contentIcon = '/'.join(typeInfo.icon_expr.split('/')[1:])
title = translate(typeInfo.title, domain=typeInfo.i18n_domain, context=self.request)
icon_link = u'<img class="svg-icon" title="%s" src="%s/%s" />' % \
(safe_unicode(escape(title)), purl, contentIcon)
(safe_unicode(escape(translate(typeInfo.Title(), context=self.request))), purl, contentIcon)
self.i_cache[item.portal_type] = icon_link
return self.i_cache[item.portal_type]

Expand Down
7 changes: 4 additions & 3 deletions src/collective/documentgenerator/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
HAS_PLONE_6 = api.env.plone_version() > '6'

DEFAULT_OO_SERVER = u'localhost'
DEFAULT_OO_PORT = "2002"
DEFAULT_OO_PORT = 2002
DEFAULT_PYTHON_UNO = u'/usr/bin/python3'
DEFAULT_COLUMN_MODIFIER = u'nothing'

DEFAULT_CSV_FIELD_DELIMITERS = {u'Comma': u',', u'Semicolon': u';', u'Colon': u':', u'Space': u' ', u'Tabulation': u'\t'}
DEFAULT_CSV_FIELD_DELIMITERS = {
u'Comma': u',', u'Semicolon': u';', u'Colon': u':', u'Space': u' ', u'Tabulation': u'\t'}
DEFAULT_CSV_STRING_DELIMITERS = {u"Double Quote": u'"', u"Single Quote": u"'"}


Expand Down Expand Up @@ -115,7 +116,7 @@ def set_oo_server():

def set_oo_port():
""" Get environment value in buildout to define port """
oo_port = safe_unicode(os.getenv('OO_PORT', DEFAULT_OO_PORT))
oo_port = unicode(os.getenv('OO_PORT', DEFAULT_OO_PORT))
if oo_port:
api.portal.set_registry_record('collective.documentgenerator.browser.controlpanel.'
'IDocumentGeneratorControlPanelSchema.oo_port_list', oo_port)
Expand Down
5 changes: 3 additions & 2 deletions src/collective/documentgenerator/content/pod_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from imio.helpers.content import add_to_annotation
from imio.helpers.content import del_from_annotation
from imio.helpers.content import get_from_annotation
from imio.helpers.content import HAS_PLONE5
from imio.helpers.content import HAS_PLONE_5_AND_MORE
from plone import api
from plone.autoform import directives as form
from plone.autoform.interfaces import IFormFieldProvider
Expand Down Expand Up @@ -40,7 +40,8 @@
import logging
import six

if HAS_PLONE5:

if HAS_PLONE_5_AND_MORE:
from collective.z3cform.datagridfield.datagridfield import DataGridFieldFactory
from collective.z3cform.datagridfield.row import DictRow
else:
Expand Down
6 changes: 3 additions & 3 deletions src/collective/documentgenerator/demo/helper.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-

from collective.documentgenerator.config import HAS_PLONE_5
from collective.documentgenerator.config import HAS_PLONE_5_2
from collective.documentgenerator.helper import ATDocumentGenerationHelperView
from collective.documentgenerator.helper import DocumentGenerationHelperView
from collective.documentgenerator.helper import DXDocumentGenerationHelperView
from collective.documentgenerator.utils import translate as _
from DateTime import DateTime
from imio.helpers.content import safe_encode
from imio.helpers import HAS_PLONE_5
from imio.helpers import HAS_PLONE_5_2
from imio.pyutils.utils import safe_encode
from plone import api
from plone.app.textfield import RichText
from plone.dexterity.events import EditCancelledEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<object name="SubTemplate" meta_type="Dexterity FTI" i18n:domain="collective.documentgenerator"
<object name="MailingLoopTemplate" meta_type="Dexterity FTI" i18n:domain="collective.documentgenerator"
xmlns:i18n="http://xml.zope.org/namespaces/i18n">
<property name="title" i18n:translate="">MailingLoopTemplate</property>
<property name="description" i18n:translate=""></property>
Expand Down
Loading

0 comments on commit 251045c

Please sign in to comment.