libtbx.str_utils
index
/net/chevy/raid1/nat/src/cctbx_project/libtbx/str_utils.py

 
Modules
       
cStringIO
sys

 
Classes
       
__builtin__.object
StringIO
find_matching_closing_symbol
framed_output
line_feeder

 
class StringIO(__builtin__.object)
    # cStringIO with pickling support
 
  Methods defined here:
__getattr__(self, *args, **kwds)
__getstate__(self)
__init__(self, *args, **kwds)
__setstate__(self, state)

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

 
class find_matching_closing_symbol(__builtin__.object)
    This functor deals with a pair of symbol, an opening symbol and a closing one,
the archetypical example being parentheses. Given the position of an opening
symbol, it returns the position of the matching closing symbol, or -1 if it does not
exist.
 
  Methods defined here:
__call__(self, string, pos)
An opening symbol shall start at position `pos` of the given `string`.
__init__(self, opening, closing)
Initialise the functor to work with the given pair. Each of `opening` and `closing`
may be several character long.

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

 
class framed_output(__builtin__.object)
    Pseudo-output file wrapper for drawing a box around arbitrary content, for
example:
 
  |----------Refinement stats--------|
  | r_free = 0.1234  r_work = 0.1567 |
  |----------------------------------|
 
The actual content will be buffered until the close() method is called or
the object is deleted, at which point the formatted text will be printed to
the actual filehandle.
 
:param out: actual output filehandle
 
  Methods defined here:
__del__(self)
__init__(self, out, title=None, width=None, frame='-', center=False, center_title=None, max_width=80, prefix=None)
add_separator(self)
close(self)
flush(self)
get_best_text_width(self)
write(self, text)

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

 
class line_feeder(__builtin__.object)
     Methods defined here:
__init__(self, f)
__iter__(self)
next(self)
next_non_empty(self)

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

 
Functions
       
contains_one_of(label, patterns)
expandtabs_track_columns(s, tabsize=8)
format_none(format, null_value=0, replace_with='None')
format_value(format, value, null_value=0, replace_none_with='None')
line_breaker(string, width)
make_big_header(line, out=None, header_len=80, border_char='#')
Alternate API for print_message_in_box, for compatibility with make_header
make_header(line, out=None, header_len=80)
make_sub_header(text, out=None, header_len=80, sep='-')
overwrite_at(s, offset, replacement)
pad_string(line, width=72, border='|')
prefix_each_line(prefix, lines_as_one_string, rstrip=True)
prefix_each_line_suffix(prefix, lines_as_one_string, suffix, rstrip=True)
print_message_in_box(message, **kwds)
py_string_representation(string, preferred_quote, alternative_quote)
based on stringobject.c, Python 2.7.2
reformat_terminal_text(text)
rstrip_lines(text)
show_sorted_by_counts(label_count_pairs, reverse=True, out=None, prefix='', annotations=None)
show_string(s)
size_as_string_with_commas(sz)
split_keeping_spaces(s)
string_representation(string, preferred_quote, alternative_quote)
strip_lines(text)
wordwrap(text, max_chars=80)

 
Data
        absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)
division = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)