Skip to content

Commit

Permalink
Added documentviewer subscriber in techdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
sgeulette committed Dec 17, 2022
1 parent 7023ad6 commit 9cf25ce
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
24 changes: 16 additions & 8 deletions docs/source/contents/subscribers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ z3c.relationfield.interfaces.IHasIncomingRelations
plone.registry.interfaces.IRecordModifiedEvent
----------------------------------------------

* Unconfigure:
* UNCONFIGURE:

* plone.registry.interfaces.IRecordModifiedEvent

Expand Down Expand Up @@ -142,7 +142,7 @@ Products.PluggableAuthService.interfaces.events.IGroupDeletedEvent
collective.contact.widget.interfaces.IContactContent
----------------------------------------------------

* Unconfigure:
* UNCONFIGURE:

* zope.lifecycleevent.interfaces.IObjectMovedEvent

Expand Down Expand Up @@ -190,7 +190,7 @@ zope.interface.Interface
collective.task.behaviors.ITask
-------------------------------

* Unconfigure:
* UNCONFIGURE:

* Products.DCWorkflow.interfaces.IAfterTransitionEvent

Expand Down Expand Up @@ -241,7 +241,7 @@ Products.PluggableAuthService.interfaces.events.IPropertiesUpdatedEvent
Products.PluggableAuthService.interfaces.events.IPrincipalAddedToGroupEvent
---------------------------------------------------------------------------

* Unconfigure:
* UNCONFIGURE:

* Products.PluggableAuthService.interfaces.events.IPrincipalAddedToGroupEvent

Expand All @@ -256,7 +256,7 @@ Products.PluggableAuthService.interfaces.events.IPrincipalAddedToGroupEvent
Products.PluggableAuthService.interfaces.events.IPrincipalRemovedFromGroupEvent
-------------------------------------------------------------------------------

* Unconfigure:
* UNCONFIGURE:

* Products.PluggableAuthService.interfaces.events.IPrincipalRemovedFromGroupEvent

Expand Down Expand Up @@ -284,6 +284,10 @@ plone.dexterity.interfaces.IDexterityContent

* .. autofunction:: dexterity.localrolesfield.subscriber.related_change_on_moving

* Products.CMFCore.interfaces.IActionSucceededEvent

* .. autofunction:: collective.documentviewer.subscribers.handle_workflow_change

* Products.DCWorkflow.interfaces.IAfterTransitionEvent

* .. autofunction:: dexterity.localroles.subscriber.related_change_on_transition
Expand All @@ -294,12 +298,16 @@ plone.dexterity.interfaces.IDexterityContent

* zope.lifecycleevent.interfaces.IObjectAddedEvent

* .. autofunction:: collective.documentviewer.subscribers.handle_file_creation

* .. autofunction:: dexterity.localroles.subscriber.related_change_on_addition

* .. autofunction:: dexterity.localrolesfield.subscriber.related_change_on_addition

* zope.lifecycleevent.interfaces.IObjectModifiedEvent

* .. autofunction:: collective.documentviewer.subscribers.handle_file_creation

* .. autofunction:: dexterity.localrolesfield.subscriber.object_modified

* zope.lifecycleevent.interfaces.IObjectMovedEvent
Expand All @@ -317,7 +325,7 @@ plone.dexterity.interfaces.IDexterityContent
dexterity.localroles.browser.interfaces.ILocalRoleListUpdatedEvent
------------------------------------------------------------------

* Unconfigure:
* UNCONFIGURE:

* dexterity.localroles.browser.interfaces.ILocalRoleListUpdatedEvent

Expand All @@ -339,7 +347,7 @@ plone.dexterity.interfaces.IDexterityFTI
z3c.relationfield.interfaces.IHasOutgoingRelations
--------------------------------------------------

* Unconfigure:
* UNCONFIGURE:

* zope.app.container.interfaces.IObjectRemovedEvent

Expand Down Expand Up @@ -455,7 +463,7 @@ Products.ATContentTypes.interfaces.folder.IATFolder
plone.app.controlpanel.interfaces.IConfigurationChangedEvent
------------------------------------------------------------

* Unconfigure:
* UNCONFIGURE:

* plone.app.controlpanel.interfaces.IConfigurationChangedEvent

Expand Down
19 changes: 13 additions & 6 deletions docs/subscribers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
check = True
zcmls = [
'src/collective.behavior.internalnumber/src/collective/behavior/internalnumber/configure.zcml',
'parts/omelette/collective/documentviewer/dexterity.zcml',
'src/collective.classification.folder/src/collective/classification/folder/content/configure.zcml',
'src/collective.classification.tree/src/collective/classification/tree/contents/configure.zcml',
'src/collective.contact.core/src/collective/contact/core/configure.zcml',
Expand Down Expand Up @@ -46,11 +47,17 @@ def resolve_path(fil, value):
if not value.startswith('.'):
return value
fparts = fil.split('/')
product = fparts[1]
start = 2
if fparts[2] == 'src':
start = 3
ns_parts = len(product.split('.'))
if fparts[0] == 'src':
product = fparts[1]
start = 2
if fparts[2] == 'src':
start = 3
ns_parts = len(product.split('.'))
elif fparts[0] == 'parts':
# asserting product name is in 2 parts
product = '{}.{}'.format(fparts[2], fparts[3])
start = 2
ns_parts = 2
rel_path = '.'.join(fparts[start+ns_parts:-1]) # can be '' or 'content'
return '{}{}{}'.format(product, rel_path and '.{}'.format(rel_path) or '', value)

Expand Down Expand Up @@ -92,7 +99,7 @@ def resolve_path(fil, value):
print(itf_fmt.format(itf, '-'*len(itf)))
unset = itfs[itf].pop('unset')
if unset:
print('\n* Unconfigure:')
print('\n* UNCONFIGURE:')
for evt, decl in unset:
print('\n * {}\n\n * .. autofunction:: {}'.format(evt and evt or itf, decl['handler']))
for evt in sorted(itfs[itf].keys()):
Expand Down

0 comments on commit 9cf25ce

Please sign in to comment.