Skip to content

Commit

Permalink
Fix refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuess committed Oct 6, 2024
1 parent cbd702e commit 4b2f5d2
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 64 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
py-versions: '["3.12", "3.11", "3.10"]'
coverage:
uses: plone/meta/.github/workflows/coverage.yml@main
dependencies:
uses: plone/meta/.github/workflows/dependencies.yml@main
# dependencies:
# uses: plone/meta/.github/workflows/dependencies.yml@main
release_ready:
uses: plone/meta/.github/workflows/release_ready.yml@main

Expand Down
42 changes: 5 additions & 37 deletions src/training/votable/configure.zcml
Original file line number Diff line number Diff line change
@@ -1,51 +1,19 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
xmlns:i18n="http://namespaces.zope.org/i18n"
xmlns:plone="http://namespaces.plone.org/plone"
i18n_domain="training.votable"
>

<i18n:registerTranslations directory="locales" />

<!--
Be careful if you use general includeDependencies, it can have side effects!
Better import explicit packages or configurations ;)
-->
<!--<includeDependencies package="." />-->


<include file="permissions.zcml" />

<include
package="plone.rest"
file="meta.zcml"
/>

<genericsetup:registerProfile
name="default"
title="training.votable"
description="Installs the training.votable add-on."
provides="Products.GenericSetup.interfaces.EXTENSION"
directory="profiles/default"
post_handler=".setuphandlers.post_install"
package="Products.CMFCore"
file="permissions.zcml"
/>

<genericsetup:registerProfile
name="uninstall"
title="training.votable (uninstall)"
description="Uninstalls the training.votable add-on."
provides="Products.GenericSetup.interfaces.EXTENSION"
directory="profiles/uninstall"
post_handler=".setuphandlers.uninstall"
/>

<utility
factory=".setuphandlers.HiddenProfiles"
name="training.votable-hiddenprofiles"
/>

<!-- -*- extra stuff goes here -*- -->
<include file="dependencies.zcml" />
<include file="profiles.zcml" />
<include file="permissions.zcml" />

<include package=".api" />
<include package=".behaviors" />
Expand Down
6 changes: 6 additions & 0 deletions src/training/votable/dependencies.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<configure xmlns="http://namespaces.zope.org/zope">

<!-- List all packages you depend here -->
<include package="plone.restapi" />

</configure>
32 changes: 32 additions & 0 deletions src/training/votable/profiles.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="training.votable"
>

<genericsetup:registerProfile
name="default"
title="training.votable: Install"
description="Package to configure a new training.votable site"
provides="Products.GenericSetup.interfaces.EXTENSION"
directory="profiles/default"
/>

<genericsetup:registerProfile
name="uninstall"
title="training.votable: Uninstall"
description="Uninstall training.votable setup."
provides="Products.GenericSetup.interfaces.EXTENSION"
directory="profiles/uninstall"
/>

<!-- Hide Uninstall Profile-->
<utility
factory=".setuphandlers.HiddenProfiles"
name="training.votable"
/>


<include package=".upgrades" />

</configure>
25 changes: 0 additions & 25 deletions src/training/votable/setuphandlers.py

This file was deleted.

11 changes: 11 additions & 0 deletions src/training/votable/setuphandlers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from Products.CMFPlone.interfaces import INonInstallable
from zope.interface import implementer


@implementer(INonInstallable)
class HiddenProfiles:
def getNonInstallableProfiles(self):
"""Hide uninstall profile from site-creation and quickinstaller."""
return [
"training.votable:uninstall",
]
Empty file.
19 changes: 19 additions & 0 deletions src/training/votable/upgrades/configure.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
>

<!-- Example upgrade step
<genericsetup:upgradeSteps
profile="training.votable:default"
source="1000"
destination="1001"
>
<genericsetup:upgradeDepends
title="Update registry value"
import_steps="plone.app.registry"
/>
</genericsetup:upgradeSteps>
-->

</configure>

0 comments on commit 4b2f5d2

Please sign in to comment.