Changes between Version 5 and Version 6 of SeattleShellBackend

Changes between Version 5 and Version 6 of SeattleShellBackend

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

Changes between Version 5 and Version 6 of SeattleShellBackend

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

Changes between Version 5 and Version 6 of SeattleShellBackend

Show
Ignore:
Timestamp:
01/24/13 19:52:48 (6 years ago)
Author:
leonwlaw
Comment:

Added details for module management within seash

Legend:

Unmodified
Added
Removed
Modified
  • SeattleShellBackend

    v5 v6  
    4747---- 
    4848 
    49 Seash has support for adding additional commands via modules that are imported on startup. These modules should be placed in the /modules/ folder. The importer will automatically import modules ending in *_module.py.  
    50  
    51 Defining a module is relatively straightforward. The only requirement for a module is that it must have a command_dict defined in the module namespace for all the commands that should be added. These command_dicts should be specified in a similar manner as described in the command dictionary section above. However, there are several differences: 
     49Seash 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. 
     50 
     51Defining 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: 
    5252 
    5353 * 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. 
     
    5959 * summary 
    6060 * help text 
    61  * display keyword (optional) 
     61 
    6262{{{ 
    6363#!python 
     
    7575      'help_text':"""...""",} 
    7676} 
    77  
    78 }}} 
    79  
    80 == Using modules == 
    81 Modules are imported when you initially start seash.  However, they are not enabled by default. 
    82  
    83 To enable a module, use the {{{enable}}} command: 
     77}}} 
     78 
     79In addition, you must have module-level documentation.  You do this by specifying a module_help string on the module-level namespace. 
     80 
     81{{{ 
     82#!python 
     83module_help = """ 
     84GeoIP Module 
     85 
     86This module includes commands that provide information regarding vessels' geographical  
     87locations.  To get started using this module, acquire several vessels through the Seattle 
     88Clearinghouse, use the 'browse' command, and then in any group, run either 'show location'  
     89or 'show coordinates'. 
     90""" 
     91}}} 
     92[[BR]] 
     93=== Current Module Information === 
     94---- 
     95To view information on all currently installed modules, you can use the {{{show modules}}} command. 
     96{{{ 
     97user@ !> help show modules 
     98show modules 
     99 
     100Shows information on all installed modules.  Modules will be separated into  
     101two categories: enabled and disabled.  Each entry will be in the following  
     102format: 
     103  [module name] - [URL where the module was installed from, if available] 
     104 
     105The URL will be missing if the module was installed manually. 
     106 
     107 
     108user@ !> show modules 
     109Enabled Modules: 
     110geoip - https://seattle.poly.edu/plugins/geoip/ 
     111 
     112Disabled Modules: 
     113selexor - https://seattle.poly.edu/plugins/selexor/   
     114 
     115}}} 
     116[[BR]] 
     117=== Module-Level Help === 
     118---- 
     119To view information about a particular module, use the {{{help module modulename}}} command.  This helptext is defined by the module creator. 
     120{{{ 
     121user@ !> help module geoip 
     122GeoIP Module 
     123 
     124This module includes commands that provide information regarding vessels' geographical  
     125locations.  To get started using this module, acquire several vessels through the Seattle 
     126Clearinghouse, use the 'browse' command, and then in any group, run either 'show location'  
     127or 'show coordinates'. 
     128 
     129}}} 
     130[[BR]] 
     131=== Installing/Uninstalling Modules === 
     132---- 
     133To install a new module, you can use the {{{install}}} command. 
     134{{{ 
     135user@ !> help install 
     136install modulename url_to_module 
     137 
     138Downloads the specified module as modulename and enables it if possible.   
     139The module will be automatically updated when you run seash. 
     140 
     141 
     142user@ !> install selexor https://seattle.poly.edu/plugins/selexor 
     143Module 'selexor' has been successfully installed and enabled. 
     144 
     145user@ !> install selexor https://seattle.poly.edu/plugins/selexor 
     146Module 'selexor' already exists.  You can either uninstall it using 'uninstall' 
     147or install it under a different name. 
     148 
     149}}} 
     150 
     151To uninstall an existing module, you can use the {{{uninstall}}} command. 
     152 
     153{{{ 
     154user@ !> help uninstall 
     155uninstall modulename 
     156 
     157Uninstalls the specified module.  Use with caution, as you cannot undo this action! 
     158You can use 'show modules' to view a list of all installed modules. 
     159 
     160 
     161user@ !> uninstall selexor 
     162Module 'selexor' has been successfully uninstalled. 
     163 
     164user@ !> uninstall selexor 
     165Module 'selexor' is not installed. 
     166 
     167}}} 
     168 
     169[[BR]] 
     170=== Enabling/Disabling Modules === 
     171---- 
     172Modules are imported when you initially start seash, but they may not be enabled depending on conflicting modules, you disabled them on a previous run, etc.  To enable a module, use the {{{enable}}} command: 
    84173{{{ 
    85174user@ !> help enable 
     
    102191}}} 
    103192 
    104 Similarly, you can disable modules using the {{{disable}}} command: 
     193Similarly, you can disable modules using the {{{disable}}} command.  This is useful if you have modules that have conflicting commands.  You can disable a module you're not currently using and enable the new module to use the conflicting command. 
    105194{{{ 
    106195user@ !> help disable