Package gmisclib :: Module named_block_file
[frames] | no frames]

Module named_block_file

source code

Read and write files in the form [label] text text text [label2] text text ...

The format is imperfect to the extent that it does not allow the text to contain things that look like labels.

When used as a script, it selects regions of such a file and prints them on the standard output: Usage: named_block_file.py key1 [key2] <input >output The sections labelled key1 and key2 will be output in order, with no separators other than a newline in between.

Functions
 
read(fd) source code
 
write_key(fd, k) source code
 
write_text(fd, t) source code
 
write_line(fd, t) source code
 
write_line_kv(fd, k, v) source code
 
write(fd, d) source code
Variables
  __package__ = 'gmisclib'

Imports: g_encode, re