Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D Documentation
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • anywave
  • Documentation
  • Wiki
  • Write Python Plugin

Write Python Plugin · Changes

Page history
Update Write Python Plugin authored Jul 24, 2025 by Bruno Colombet's avatar Bruno Colombet
Show whitespace changes
Inline Side-by-side
Showing with 37 additions and 1 deletion
+37 -1
  • Write-Python-Plugin.md Write-Python-Plugin.md +37 -1
  • No files found.
Write-Python-Plugin.md
View page @ faca200b
...@@ -77,8 +77,44 @@ import anywave as aw ...@@ -77,8 +77,44 @@ import anywave as aw
aw.init(sys.argv) aw.init(sys.argv)
args = aw.get_props() args = aw.get_props()
``` ```
args is a dict containing all the properties related to AnyWave current data file and the plugin context. args is a dict containing all the properties related to AnyWave current data file and the plugin context.
When using the Plugin Creation Assistant of AnyWave, the file is automatically created.
## Command Line
You may want your plugin to be used when AnyWave is launched using the command line.
AnyWave can run processes/plugins when launched that way:
````bash
anywave --run MyPlugin --input_file <filepath> --plugin_option1 option --plugin_option2 option ...
````
### Add a flag to desc.txt
Add or edit the following line in desc.txt:
````test
flags = CanRunFromCommandLine
````
Note that you can set several flags separating them by '**:**'
### Handle command line options
By default the plugin will have all parameters passed to anywave in the resulting args variable after the call to:
````python
import anywave as aw
import sys
aw.init(sys.argv)
args = aw.get_props();
print(args["plugin_option1"]) # value for plugin_option1 from the command line.
print(args["plugin_option2"]) # value for plugin_option2 from the command line.
````
However, this is possible only if we inform AnyWave about _plugin_option1_ and _plugin_option2_.
Otherwise, an error will occur when using the command line saying that _plugin_option1_ and _plugin_option2_ are unknown options.
#### Register specific options
To add support for specific command line option, add a file called **args.json** in the plugin folder.
This is a JSON file that must be like this:
````json
{
"Parameters" : ["plugin_option1", "plugin_option2"]
}
````
## [DEBUG Python plugin](/anywave/documentation/-/wikis/Python_debug) ## [DEBUG Python plugin](/anywave/documentation/-/wikis/Python_debug)
......
Clone repository
  • Build_AnyWave
  • CLI
  • CLI_List
  • Changes
  • ExportData
  • ICA
  • Imaginary Coherence
  • MATLAB anywave function
  • MATLAB_BIDS
  • MATLAB_change_sig_prop
  • MATLAB_debug
  • MATLAB_get_data
  • MATLAB_get_markers
  • MATLAB_get_props
  • MATLAB_init
View All Pages