Package atmopy :: Package talos :: Module miscellaneous
[show private | hide private]
[frames | no frames]

Module atmopy.talos.miscellaneous

Classes
PrintInPlace PrintInPlace enables to write and overwrite data on screen.

Function Summary
(list of string, list) apply_module_functions(module, args, functions)
Applies functions (with the right number of arguments) from a given module to the arguments of 'args'.
(list of string, list) get_module_functions(module, Nargs, functions)
Lists the functions, with 'Nargs' arguments, from a given module.
Boolean is_int(str)
Tests whether a string is an integer.
Boolean is_num(str)
Tests whether a string is a number.
  print_stdout_file(elt, file, end_line)
Prints an element on standard output and in a file (if ready).
  remove_file(files)
Removes one or more files and/or directories (without confirmation).
  replace_string(string_in, string_out, files)
Replaces a string 'string_in' with 'string_out' in one or more files.
int (preferred) or float to_num(str)
Converts a string to a number.

Function Details

apply_module_functions(module, args, functions=('all',))

Applies functions (with the right number of arguments) from a given module to the arguments of 'args'.
Parameters:
module - The module in which the functions are found.
           (type=module)
args - The arguments to call the functions with.
           (type=list)
functions - The list of functions to be applied. If 'functions' contains 'all', then all functions are applied (only once).
           (type=list of string)
Returns:
The list of applied functions and the list of results.
           (type=(list of string, list))

get_module_functions(module, Nargs, functions=('all',))

Lists the functions, with 'Nargs' arguments, from a given module.
Parameters:
module - The module in which the functions are found.
           (type=module)
Nargs - The possible number(s) of arguments.
           (type=integer, or list of integer)
functions - The list of functions to be possibly listed. If 'functions' contains 'all', then all functions are listed (only once).
           (type=list of string)
Returns:
The list of functions that could be called with 'Nargs' arguments.
           (type=(list of string, list))

is_int(str)

Tests whether a string is an integer.
Parameters:
str - String to be tested.
           (type=string)
Returns:
True if 'str' is a integer, False otherwise.
           (type=Boolean)

is_num(str)

Tests whether a string is a number.
Parameters:
str - String to be tested.
           (type=string)
Returns:
True if 'str' is a number, False otherwise.
           (type=Boolean)

print_stdout_file(elt, file, end_line=True)

Prints an element on standard output and in a file (if ready).
Parameters:
elt - The element to be printed.
           (type=convertible to string)
file - The file into which the element is to be printed. If nothing is to be printed in a file, 'file' should be None.
           (type=file descriptor or None)
end_line - True if a line break should be appended after 'elt', False otherwise.
           (type=Boolean)

remove_file(files)

Removes one or more files and/or directories (without confirmation).
Parameters:
files - files and directories to be removed.
           (type=string or list of strings)

replace_string(string_in, string_out, files)

Replaces a string 'string_in' with 'string_out' in one or more files.
Parameters:
string_in - string to be replaced.
           (type=string)
string_out - new string.
           (type=string)
files - files in which 'string_in' is replaced.
           (type=string or list of strings)

to_num(str)

Converts a string to a number.
Parameters:
str - String to be converted.
           (type=string)
Returns:
The number represented by 'str'.
           (type=int (preferred) or float)

Generated by Epydoc 2.1 on Tue May 19 10:37:12 2009 http://epydoc.sf.net