nrvr.util.requirements
index
/usr/lib/python2.7/site-packages/nrvr/util/requirements.py

nrvr.util.requirements - Utilities for requirements for running script
 
Class provided by this module is SystemRequirements.
 
As implemented works in Linux.
As implemented requires which command.
 
Idea and first implementation - Leo Baschy <srguiwiz12 AT nrvr DOT com>
 
Contributor - Nora Baschy
 
Public repository - https://github.com/srguiwiz/nrvr-commander
 
Copyright (c) Nirvana Research 2006-2015.
Simplified BSD License

 
Classes
       
__builtin__.object
SystemRequirements

 
class SystemRequirements(__builtin__.object)
    Utilities regarding requirements on machine for running the script.
 
As implemented requires which command.
 
  Class methods defined here:
commandsAvailable(cls, commands, listWhich=False) from __builtin__.type
Return allRequiredFound or a 2-tuple (allRequiredFound, whichCommandsFound).
 
Default to return a boolean value whether all required commands have been found.
 
Can return a 2-tuple with first item being a boolean value whether all required commands
have been found, and second item being a list of which commands have been found.
 
commands
    a list of strings, one for each command to be found.
    To allow alternatives, if instead of a string there is a tuple of sublists then
    whether for at least one sublist of the tuple all commands can be found.
 
listWhich
    whether to return a 2-tuple (allRequiredFound, whichCommandsFound).
    Default only to return a boolean value allRequiredFound.
commandsRequired(cls, commands, verbose=False) from __builtin__.type
Raise exception if a required command cannot be found.
 
Return a list of which commands have been found.
 
commands
    a list of strings, one for each required command.
    To allow alternatives, if instead of a string there is a tuple of sublists then
    for at least one sublist of the tuple all commands are required.
commandsRequiredByImplementations(cls, implementations, verbose=False) from __builtin__.type
Raise exception if a required command cannot be found.
 
Return a list of which commands have been found.
commandsUsedInImplementation(cls) from __builtin__.type
Return a list to be passed to SystemRequirements.commandsRequired().
 
This class can be passed to SystemRequirements.commandsRequiredByImplementations().
 
This method in this very class is more of a demo, and usable for unit testing.
An equivalent method in other classes could actually be useful.
which(cls, command) from __builtin__.type
Return path to command, or None if none found.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)