Changes between Version 7 and Version 8 of SeattleShellBackend

Changes between Version 7 and Version 8 of SeattleShellBackend

Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Changes between Version 7 and Version 8 of SeattleShellBackend

Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Changes between Version 7 and Version 8 of SeattleShellBackend

Show
Ignore:
Timestamp:
02/07/13 20:54:39 (6 years ago)
Author:
leonwlaw
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SeattleShellBackend

    v7 v8  
    4949Seash has support for adding additional commands via modules that are imported on startup. These modules should be placed in a subdirectory within the /modules/ folder. The importer will try to look for a *.seashplugin.py file in each module folder and import it.  There should only be one such file in each module. 
    5050 
    51 Defining a module is relatively straightforward.  There must be a *.seashplugin.py file that contains the main command_dict for the module.  It defines all the commands that are to be part of the module.  These command_dicts should be specified in a similar manner as described in the command dictionary section above. However, there are several differences: 
    52  
    53  * You specify the full command on the top level of the command dictionary.  The entire command becomes the key entry.  The importer will use this to figure out where to insert the node. 
    54  * Commands should not have any child entries.  These will be automatically generated by the importer as the dictionary is being populated. 
    55  
    56 Therefore, each command node needs to have the following elements: 
    57  * name 
    58  * callback 
    59  * summary 
    60  * help text 
     51Defining a module is relatively straightforward.  There must be a __init__.py file that contains the main command_dict for the module.  It defines all the commands that are to be part of the module.  These command_dicts should be specified in a similar manner as described in the command dictionary section above.  
    6152 
    6253{{{ 
    6354#!python 
    6455command_dict = { 
    65   'show location':{ 
     56  'show': {'children': { 
     57    'location':{ 
    6658      'name':'location', 
    6759      'callback': show_location_callback, 
    6860      'summary': "Display location information (countries) for the nodes", 
    69       'help_text':"""...""",}, 
    70  
    71   'show coordinates':{ 
     61      'help_text':"""...""",}}, 
     62    'coordinates':{ 
    7263      'name':'coordinates', 
    7364      'callback': show_coordinates_callback, 
    7465      'summary':'Display the latitude & longitude of the node', 
    7566      'help_text':"""...""",} 
    76 } 
    77 }}} 
    78  
    79 In addition, you must have module-level documentation.  You do this by specifying a module_help string on the module-level namespace. 
     67}}} 
     68 
     69You must also have module-level documentation.  You do this by specifying a module_help string on the module-level namespace. 
    8070 
    8171{{{ 
     
    9080""" 
    9181}}} 
     82 
     83You must also specify an update URL to where your module can be found.  This will be used with the updater to automatically update the module.  To disable this feature, set the URL to {{{None}}}. 
     84{{{ 
     85#!python 
     86url = '''http://seattle.poly.edu/plugins/geoip/''' 
     87}}} 
    9288[[BR]] 
    9389=== Current Module Information ===