4Suite™ API Documentation

# ► Module Ft.Server.Client.Commands.CommandUtil

Functions used by various '4ss' command implementations.
Copyright 2004 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/

Functions: GetRepository, WritePreamble

## Functions

GetRepository(options, cmdName)
Given an options dictionary and the name of a command, uses the options in an attempt to obtain a repository access object, then verifies that the user attempting the access has execute access on the corresopnding Command resource in the repository. If successful, returns the repository access object. Otherwise, prints an exception message to standard error and returns None.
WritePreamble(heading, uchar='=', maxwidth=None, stream=<open file '<stderr>', mode 'w' at 0x484170b0>)
Commands that need to preface their output with a preamble can use this function to write it to the output stream (a file-like object) in a consistent way. The given heading will be wrapped if necessary to fit within a maximum width, then will be written out, followed by a row a underline characters that is as wide as the widest line in the heading.