Skip to main content

Python module interface

Project description

pymodule

Provide a python interface to RHEL module. Two functions are provided:

  • list - List loaded modules
  • __call__ - will run module with the given args as a list of strings or multiple string arguments

Usage

    from pymodule import pymodule
    module = pymodule.PyModule()
    # List loaded modules:
    module.list()
    # Load modules
    module('load', 'bash')
    module(['load','bash'])
    # The entire set of commands are supported via __call__
    # as example
    module('purge')

Configuration

Please override the following defaults with your system specific ones before creating a PyModule instance, the defaults are shown in parentheses

  • MODULE_VERSION ('3.2.10') - used to set the version
  • MODULESHOME ('/apps/RH7U2/Modules/%s' % MODULE_VERSION) - used as base path to bin/modulecmd and to init/.modulespath
  • MODULE_RE ('\d+)\s+([\w/.]+)') - used to parse module list output and return match 'module/version' i.e. git/2.11.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pymodule, version 0.2a0
Filename, size File type Python version Upload date Hashes
Filename, size pymodule-0.2a0.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page