Opened 8 years ago

Closed 8 years ago

#784 closed defect (fixed)

Revise BundleAPI for registering commands

Reported by: Greg Couch Owned by: Conrad Huang
Priority: blocker Milestone: Alpha 3
Component: Core Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Instead of passing in the command name, pass in the bundle's information about the command -- the command name and synopsis. That way the delayed command registration can reuse the synopsis.

Change History (3)

comment:1 by Conrad Huang, 8 years ago

Milestone: Beta ReleaseAlpha 3

comment:2 by Conrad Huang, 8 years ago

Component: UnassignedCore
Owner: set to Conrad Huang
Status: newassigned

comment:3 by Conrad Huang, 8 years ago

Resolution: fixed
Status: assignedclosed

Implemented.

Classes derived from BundleAPI that have attribute api_version == 0 use the old API while those with api_version > 0 use the new API.

Bundles using the old API are notified of command registration and tool invocation with:

api.register_command(command_name, logger)
api.start_tool(session, tool_name, kw)

while those with API version == 1 are notified with:

api.register_command(bundle_info, command_info, logger)
api.start_tool(session, bundle_info, tool_info, kw)

command_name and tool_name are strings. *_info arguments are instances of classes from chimerax.core.toolshed.

Note: See TracTickets for help on using tickets.