Logo Pytrainer


Documentation:

  1. Users

    1. Configuring pytrainer for first time
  2. Developers

    1. Build your own Gps Device Plugin



Configuring Pytrainer for first time



The first time you launch pytrainer a preferences dialog will with 3 stepts prompt up. Edit the first page with your personal information like in the next image.

In the next step you can configure your database. For dummy users i recommend sqlite, like in the next image

Finally, edit your sports in the last step



Build your own Gps Device Plugin

(pytrainer 1.2.0 and later)

Build your own Pytrainer gps device plugin is very easy.
  • Make a dir in the plugins file.
    for example: #mkdir /somepath/pytrainer/plugins/yourplugin
  • Create a config plugin file.
    for example: #touch /somepath/pytrainer/plugins/yourplugin/conf.xml
  • Edit the conf plugin file with this code:
<?xml version="1.0" ?>
<pytrainer-plugin
     name="Plugin name (for example: Garmin 301)"
     description="Plugin description (for example: Import from your garmin 301)"
     plugincode="Internal plugin code without spaces (for example: garmin301)"
     pluginbutton="Text to show in the button (for example: Import from Garmin 301)"
     executable="The executable plugin script (for example: main.py)"
     author="The author plugin (for example: Fulano Palotes)"
    >
     <conf-values variable="variable conf name (for example: device)"
         value="variable conf default value (for example: /dev/ttyUSB0)"/>
</pytrainer-plugin>
  • You can add so many conf-values lines in the conf plugin file as you need it.
  • create the executable plugin script like you have named it in the conf plugin file.
    For example: touch /somepath/pytrainer/plugins/yourplugin/main.py
  • Edit the executable plugin script. You can write it in any language. There are only two rules.
    • Pytrainer will launch the executable plugin script with too many parameters as conf-values you defined in the plugin file.
      For example, if your executable plugin script is main.sh and you have inserted one conf-value line in the plugin file (conf-values variable="device") pytriner will launch your executable plugin script in this way:
      /path/main.sh --device "value"
    • Your script must print the gpx file path
  • i wil write some several lenguages example plugins in the future
  • Please, if you write a plugin, send me it by email in order to include it in pytrainer package.


Developed by vud1 under GPL licence