Skip to content

Commit

Permalink
Ran 'make format'
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Jul 1, 2022
1 parent 2825faa commit b851193
Show file tree
Hide file tree
Showing 25 changed files with 766 additions and 775 deletions.
8 changes: 4 additions & 4 deletions plone/dexterity/browser/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DefaultAddForm(DexterityExtensibleForm, form.AddForm):

portal_type = None
immediate_view = None
success_message = _(u"Item created")
success_message = _("Item created")

def __init__(self, context, request, ti=None):
super(DefaultAddForm, self).__init__(context, request)
Expand Down Expand Up @@ -119,10 +119,10 @@ def handleAdd(self, action):
self._finishedAdd = True
IStatusMessage(self.request).addStatusMessage(self.success_message, "info")

@button.buttonAndHandler(_(u"Cancel"), name="cancel")
@button.buttonAndHandler(_("Cancel"), name="cancel")
def handleCancel(self, action):
IStatusMessage(self.request).addStatusMessage(
_(u"Add New Item operation cancelled"), "info"
_("Add New Item operation cancelled"), "info"
)
self.request.response.redirect(self.nextURL())
notify(AddCancelledEvent(self.context))
Expand Down Expand Up @@ -153,7 +153,7 @@ def label(self):
portal_type = self.portal_type
fti = getUtility(IDexterityFTI, name=portal_type)
type_name = fti.Title()
return _(u"Add ${name}", mapping={"name": type_name})
return _("Add ${name}", mapping={"name": type_name})


class DefaultAddView(layout.FormWrapper, BrowserPage):
Expand Down
2 changes: 1 addition & 1 deletion plone/dexterity/browser/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class DexterityExtensibleForm(AutoExtensibleForm):
"""Mixin class for Dexterity forms that support updatable fields"""

default_fieldset_label = _("label_schema_default", default=u"Default")
default_fieldset_label = _("label_schema_default", default="Default")

@property
def description(self):
Expand Down
137 changes: 69 additions & 68 deletions plone/dexterity/browser/configure.zcml
Original file line number Diff line number Diff line change
@@ -1,88 +1,89 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="plone">
i18n_domain="plone"
>

<!-- Standard view -->
<browser:page
for="..interfaces.IDexterityContent"
name="view"
class=".view.DefaultView"
template="item.pt"
permission="zope2.View"
/>
<!-- Standard view -->
<browser:page
name="view"
for="..interfaces.IDexterityContent"
class=".view.DefaultView"
template="item.pt"
permission="zope2.View"
/>

<!-- Content core views -->
<!-- Note: the templaces are the same since the changes for
<!-- Content core views -->
<!-- Note: the templaces are the same since the changes for
https://github.com/plone/Products.CMFPlone/issues/3177
That may be okay: makes it easier to customize
only the template for items or for containers. -->
<browser:page
for="..interfaces.IDexterityItem"
name="content-core"
class=".view.DefaultView"
template="itemcontentcore.pt"
permission="zope2.View"
/>
<browser:page
name="content-core"
for="..interfaces.IDexterityItem"
class=".view.DefaultView"
template="itemcontentcore.pt"
permission="zope2.View"
/>

<browser:page
for="..interfaces.IDexterityContainer"
name="content-core"
class=".view.DefaultView"
template="containercontentcore.pt"
permission="zope2.View"
/>
<browser:page
name="content-core"
for="..interfaces.IDexterityContainer"
class=".view.DefaultView"
template="containercontentcore.pt"
permission="zope2.View"
/>

<!-- Standard IPublishTraverse adapter -->
<adapter factory=".traversal.DexterityPublishTraverse" />
<!-- Standard IPublishTraverse adapter -->
<adapter factory=".traversal.DexterityPublishTraverse" />

<!-- Standard add view and form - invoked from ++add++ traverser -->
<adapter
for="Products.CMFCore.interfaces.IFolderish
zope.publisher.interfaces.browser.IDefaultBrowserLayer
..interfaces.IDexterityFTI"
provides="zope.publisher.interfaces.browser.IBrowserPage"
factory=".add.DefaultAddView"
<!-- Standard add view and form - invoked from ++add++ traverser -->
<adapter
factory=".add.DefaultAddView"
provides="zope.publisher.interfaces.browser.IBrowserPage"
for="Products.CMFCore.interfaces.IFolderish
zope.publisher.interfaces.browser.IDefaultBrowserLayer
..interfaces.IDexterityFTI"
/>
<class class=".add.DefaultAddView">
<require
permission="cmf.AddPortalContent"
interface="zope.publisher.interfaces.browser.IBrowserPage"
/>
<class class=".add.DefaultAddView">
<require
permission="cmf.AddPortalContent"
interface="zope.publisher.interfaces.browser.IBrowserPage"
/>
</class>
</class>

<!-- Standard edit view -->
<browser:page
for="..interfaces.IDexterityContent"
name="edit"
class=".edit.DefaultEditView"
permission="cmf.ModifyPortalContent"
/>
<!-- Standard edit view -->
<browser:page
name="edit"
for="..interfaces.IDexterityContent"
class=".edit.DefaultEditView"
permission="cmf.ModifyPortalContent"
/>

<!-- FTI add form -->
<browser:page
for="zope.browser.interfaces.IAdding"
name="plone.dexterity.fti"
template="fti.pt"
class=".fti.FTIAddView"
permission="cmf.ManagePortal"
/>
<!-- FTI add form -->
<browser:page
name="plone.dexterity.fti"
for="zope.browser.interfaces.IAdding"
class=".fti.FTIAddView"
template="fti.pt"
permission="cmf.ManagePortal"
/>

<!-- Resources for icons -->
<!-- Resources for icons -->

<browser:resource
name="plone.dexterity.item.gif"
file="icons/item_icon.gif"
/>
<browser:resource
name="plone.dexterity.item.gif"
file="icons/item_icon.gif"
/>

<browser:resource
name="plone.dexterity.container.gif"
file="icons/container_icon.gif"
/>
<browser:resource
name="plone.dexterity.container.gif"
file="icons/container_icon.gif"
/>

<browser:resource
name="plone.dexterity.fti.gif"
file="icons/typeinfo.gif"
/>
<browser:resource
name="plone.dexterity.fti.gif"
file="icons/typeinfo.gif"
/>

</configure>
10 changes: 5 additions & 5 deletions plone/dexterity/browser/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

class DefaultEditForm(DexterityExtensibleForm, form.EditForm):

success_message = _(u"Changes saved")
success_message = _("Changes saved")

@button.buttonAndHandler(_(u"Save"), name="save")
@button.buttonAndHandler(_("Save"), name="save")
def handleApply(self, action):
data, errors = self.extractData()
if errors:
Expand All @@ -32,9 +32,9 @@ def handleApply(self, action):
self.request.response.redirect(self.nextURL())
notify(EditFinishedEvent(self.context))

@button.buttonAndHandler(_(u"Cancel"), name="cancel")
@button.buttonAndHandler(_("Cancel"), name="cancel")
def handleCancel(self, action):
IStatusMessage(self.request).addStatusMessage(_(u"Edit cancelled"), "info")
IStatusMessage(self.request).addStatusMessage(_("Edit cancelled"), "info")
self.request.response.redirect(self.nextURL())
notify(EditCancelledEvent(self.context))

Expand Down Expand Up @@ -74,7 +74,7 @@ def fti(self):
@property
def label(self):
type_name = self.fti.Title()
return _(u"Edit ${name}", mapping={"name": type_name})
return _("Edit ${name}", mapping={"name": type_name})


DefaultEditView = layout.wrap_form(DefaultEditForm)
Expand Down
2 changes: 1 addition & 1 deletion plone/dexterity/browser/fti.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class FTIAddView(FactoryTypeInformationAddView):
"""Add view for the Dexterity FTI type"""

klass = DexterityFTI
description = u"Factory Type Information for Dexterity Content Types"
description = "Factory Type Information for Dexterity Content Types"
Loading

0 comments on commit b851193

Please sign in to comment.