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.

Source Distribution

pymodule-0.2a0.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file pymodule-0.2a0.tar.gz.

File metadata

  • Download URL: pymodule-0.2a0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.35.0 CPython/3.6.7

File hashes

Hashes for pymodule-0.2a0.tar.gz
Algorithm Hash digest
SHA256 1ecccd70ce8686093f4e7fff4c462635d70193254f2d5240eb06d8c8cc0157d2
MD5 f79a68c919bb7f8030f81ba62307d437
BLAKE2b-256 04dae5fa48f6a9b18cd1e54a38c50b280a9ea0839e0644e94c2f853a9498f7a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page