Package pyb :: Module util
[show private | hide private]
[frames | no frames]

Module pyb.util

Utility functions.

Copyright (C) 2004 Aetrion LLC

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Classes
_test Unit tests for this module

Function Summary
  filterFileList(files, fileFilters, filterType)
Filter a file list.
  filterFiles(basedir, fileFilters, filterType)
Filter files starting from a specified base directory returning a list of files which pass through the filter.
  filterNewerFiles(files, regex, replace)
Filter files so that only files which are newer.
  log(task, message)
Log an error message.
  unzip(src, destdir, taskname)
Internal function to unzip the specified file into the given directory.

Variable Summary
int EXCLUDE = 2                                                                     
int INCLUDE = 1                                                                     

Function Details

filterFileList(files=[], fileFilters=[], filterType=1)

Filter a file list.
Parameters:
files - The file list
fileFilters - Compiled regular expressions
filterType - Either INCLUDE or EXCLUDE (defaults to INCLUDE)
Returns:
A list of filtered files

filterFiles(basedir, fileFilters=[], filterType=1)

Filter files starting from a specified base directory returning a list of files which pass through the filter.

Either basedir or files is required.
Parameters:
basedir - The base directory
fileFilters - Compiled regular expressions
filterType - Either INCLUDE or EXCLUDE (defaults to INCLUDE)
Returns:
A list of file names

filterNewerFiles(files, regex='', replace='')

Filter files so that only files which are newer.
Parameters:
files - The source files
regex - ...
replace - ...
Returns:
A filtered list of files

log(task, message)

Log an error message.
Parameters:
task - The task name
message - The message

unzip(src, destdir, taskname)

Internal function to unzip the specified file into the given directory.

Build scripts should not call this function directly, rather they should use the tasks.core.unzip() function.

src: The source zip file destdir: The destination directory taskname: The taskname

Variable Details

EXCLUDE

Type:
int
Value:
2                                                                     

INCLUDE

Type:
int
Value:
1                                                                     

Generated by Epydoc 2.1 on Fri Apr 23 15:39:19 2004 http://epydoc.sf.net