| Home | Trees | Index | Help |
|---|
| Package Yab :: Module Util |
|
This file holds misc Yab utilities. Global variables: run_quietly - When set, output from message and progress_message is stifled.
| Classes | |
|---|---|
File |
This class is used to store information about a file or directory on the file system. |
| Function Summary | |
|---|---|
Execute the commands as in make. | |
chdir(dir)
| |
Clear the cache loaded by load_cache. | |
Execute the commands as in make. | |
Implement Ant's notion of a "FileSet.":http://jakarta.apache.org/ant/manual/CoreTypes/fileset.html The function will return a list of files that match the "includes" patterns and **do not** match the "excludes" patterns. | |
Return the value of 'name' in a callers global namespace. | |
Create a File from the given pathname. | |
Return the global namespace of the caller that has a value for 'name' in its global namepace. | |
Return the shell environment after a given command is run. | |
Get the test result for a given toolset and test_name. | |
get_token()
| |
Is the pathname an absolute path. | |
isFile(x)
| |
Load persistent information from the given path (usually .yabcache). | |
Print a message to the console, add a newline, and flush. | |
minishell(cmds,
env)
| |
normalize(path)
| |
Return a single File object that represents the given file. | |
Returns a list of 'File'es for one of the ways to specify a set of files. | |
Print string + "..." to the console to represent the start of an operation. | |
Save the cache to the given path. | |
Set the test result for a given toolset and test_name. | |
Execute the commands as in make. | |
Trim the whitespace between tokens (including newlines). | |
Create a File from the given pathname. | |
Search the system's path for the given executable name. | |
| Variable Summary | |
|---|---|
int |
cache_version = 10 |
NoneType |
cmd_interp = None |
SRE_Pattern |
env_var_re = ^([^=]+)=(.*)$
|
dict |
file_info_map = {}
|
NoneType |
minishell_impl = None |
int |
run_quietly = 0 |
dict |
test_results = {}
|
SRE_Pattern |
triml = ^\s+
|
int |
unique_token_counter = 1 |
dict |
whereis_map = {('D:\\Program Files\\Microsoft Visual Stu...
|
SRE_Pattern |
whitespace_re = \s{2,}
|
| Function Details |
|---|
bat_minishell(cmds, env=None)Execute the commands as in make. One command per line, a leading '-' means ignore the result code. If a command, not prefixed by '-', returns a non-zero result, stop processing and return a non-zero result. Variable substitution should have already been done. If 'env' is set, use that dictionary as the command environment. |
clear_cache()Clear the cache loaded by load_cache. |
cmd_minishell(cmds, env=None)Execute the commands as in make. One command per line, a leading '-' means ignore the result code. If a command, not prefixed by '-', returns a non-zero result, stop processing and return a non-zero result. Variable substitution should have already been done. If 'env' is set, use that dictionary as the command environment. |
fileset(includes=['**/*'], excludes=[], base_dir='.', contains=None, inc_dirs=None, file_objects=None)Implement Ant's notion of a "FileSet.":http://jakarta.apache.org/ant/manual/CoreTypes/fileset.html The function will return a list of files that match the "includes" patterns and **do not** match the "excludes" patterns. |
get_caller_global(name)Return the value of 'name' in a callers global namespace. Look up the call stack until it is found. raise ValueError if the name is not found. |
get_file_info(path)Create a File from the given pathname. Path MUST be absoulute filename. |
get_globals_containing(name)Return the global namespace of the caller that has a value for 'name' in its global namepace. |
get_resulting_env(command)Return the shell environment after a given command is run. |
get_test_result(toolset, test_name)Get the test result for a given toolset and test_name. If the test was never run, raise KeyError. |
is_abs_path(x)Is the pathname an absolute path. Workaround for a bug in the python runtime library. |
load_cache(path)Load persistent information from the given path (usually .yabcache). The cache contains information that is time consuming to calculate and that can be preserved from run to run. In includes: 1 File objects 2 test results 3 whereis information |
message(string)Print a message to the console, add a newline, and flush. |
parse_file(file, dir=None)Return a single File object that represents the given file. 'File' may be: 1 a File object, which is just returned 2 a string, that is interpreted relative to the passed in 'dir' parameter. If no 'dir' is specified, the default is where the calling script is located (**not** the current directory). If dir *is* specified, it is relative to the current directory (be careful when using this) |
parse_files(files, dir=None)Returns a list of 'File'es for one of the ways to specify a set of files. These are: 1 a string that is split to get a list of paths 2 a list of strings (usefull if you need to specify filenames with whitespace in them. 3 a File object 4 a Target object (files are the target's target_paths) These names are interpreted relative to the directory passed in as the 'dir' parameter. If no 'dir' is specified, the default is where the calling script is located (**not** the current directory). |
progress_message(string)Print string + "..." to the console to represent the start of an operation. You should call message() after the operation completes to print the result. |
save_cache(path)Save the cache to the given path. |
set_test_result(toolset, test_name, value)Set the test result for a given toolset and test_name. These results are stored in the cache. |
sh_minishell(cmds, env=None)Execute the commands as in make. One command per line, a leading '-' means ignore the result code. If a command, not prefixed by '-', returns a non-zero result, stop processing and return a non-zero result. Variable substitution should have already been done. If 'env' is set, use that dictionary as the command environment. |
singleline(string)Trim the whitespace between tokens (including newlines). |
unsafe_get_file_info(normpath)Create a File from the given pathname. The pathname must be absoulite and have been returned from Util.normalize. |
whereis(file)Search the system's path for the given executable name. On win32 systems, check for <file>.exe and <file>.bat. On unix, check for an executable file (that is not a directory) Cached for speed. |
| Variable Details |
|---|
cache_version
|
cmd_interp
|
env_var_re
|
file_info_map
|
minishell_impl
|
run_quietly
|
test_results
|
triml
|
unique_token_counter
|
whitespace_re
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.0 on Fri Aug 15 16:30:51 2003 | http://epydoc.sf.net |