11 Commits

Author SHA1 Message Date
Wirawan Purwanto
b93d40d0fc * Added my tools to parse/process textual table, from Cr2 project. 2015-06-04 16:05:49 -04:00
Wirawan Purwanto
ad841e0b90 * text_input.read_items(): added option end_line_match' and last_line_match'
(mutually exclusive options) to allow the dataset reading to end upon
  encountering certain text pattern (or a more complicated match, if we
  specify a function for the option value).
  These options can be used to work with the `maxcount' option; the shortest
  of the two (maxcount records read first, or end/last_line_match finds a
  match) will end the reading of the dataset.
2012-04-17 11:03:29 -04:00
Wirawan Purwanto
606214eb66 * Changing all isinstance(STUFF, str)' to isinstance(STUFF, basestring)'
for future-proofing this code.
2012-04-13 17:10:32 -04:00
Wirawan Purwanto
6656d3d5e3 * In module text_input: Added head() and tail() to emulate the basic
behavior of UNIX commands with the same name.
  Output lines are already split into a list of strings.
2012-03-19 16:53:23 -04:00
Wirawan Purwanto
f8a101fbe9 * Added comment_char option for text_input object creation.
* Memory leak bugfix: Use instance method weakref.
2012-02-15 23:02:11 -05:00
wirawan
81e2ada60c * Allow comment character to be changed from "#" using the
instance.comment_char attribute.
2011-09-16 21:21:23 +00:00
wirawan
c675077620 * Introducing self.lineno counter for line numbers (including the blanks
and comment lines).
2011-09-05 19:09:21 +00:00
wirawan
3b522de2d6 * Added text_input.close() method. 2011-08-31 20:28:30 +00:00
wirawan
ad73b5af7f * Added set_next_proc() method to set which procedure should be called when
"next()" method dispatcher is called.

  This approach should get rid of the problem with circular reference which
  causes the text_input instance not be erasable because of strong reference
  to `self' in `self.next.im_self'.
2011-06-03 21:34:32 +00:00
wirawan
96d1f9afd7 * Upgrade to allow reading complex-valued data directly.
Please see the documentation of text_input.read_items for more detail.
2010-09-30 17:23:34 +00:00
wirawan
cae9cabdea * Simple text input reader. Imported from pyqmc.utils.text_input . 2010-09-27 19:54:05 +00:00