From 4c9b5ce9f7575be1dcc1e9d499fc2793f6dd2e31 Mon Sep 17 00:00:00 2001 From: wirawan Date: Mon, 27 Sep 2010 19:54:29 +0000 Subject: [PATCH] * Update documentations. --- file/.cvsignore | 2 ++ file/file_utils.py | 10 +++++++++- text_tools.py | 5 ++++- timer.py | 12 +++++++++++- 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 file/.cvsignore diff --git a/file/.cvsignore b/file/.cvsignore new file mode 100644 index 0000000..52e4e61 --- /dev/null +++ b/file/.cvsignore @@ -0,0 +1,2 @@ +*.pyc +*.pyo diff --git a/file/file_utils.py b/file/file_utils.py index 2747c80..ee7885c 100644 --- a/file/file_utils.py +++ b/file/file_utils.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# $Id: file_utils.py,v 1.1 2010-09-27 19:47:19 wirawan Exp $ +# $Id: file_utils.py,v 1.2 2010-09-27 19:54:29 wirawan Exp $ # # pyqmc.utils.file_utils module # File-manipulation utilities @@ -11,6 +11,14 @@ # They are not necessarily suitable for general-purpose uses; evaluate # your needs and see if they can them as well. # +# 20090601: Created as pyqmc.utils.file_utils . +# 20100927: Moved to wpylib.file.file_utils . +# +""" +Common file-manipulation utilities. + +This module is part of wpylib project. +""" import bz2 import glob diff --git a/text_tools.py b/text_tools.py index 250ee85..c2bcc2c 100644 --- a/text_tools.py +++ b/text_tools.py @@ -1,4 +1,4 @@ -# $Id: text_tools.py,v 1.4 2010-05-28 18:46:53 wirawan Exp $ +# $Id: text_tools.py,v 1.5 2010-09-27 19:54:26 wirawan Exp $ # # wpylib.text_tools # Created: 20091204 @@ -105,9 +105,12 @@ def str_expand(template, params, maxiter=100): def str_grep(S, strs): + """Returns a list of strings wherein the substring S is found.""" return [s for s in strs if s.find(S) >= 0] def str_igrep(S, strs): + """Returns a list of the indices of the strings wherein the substring S + is found.""" return [i for (s,i) in zip(strs,xrange(len(strs))) if s.find(S) >= 0] diff --git a/timer.py b/timer.py index 766ea96..0edc510 100644 --- a/timer.py +++ b/timer.py @@ -1,4 +1,4 @@ -# $Id: timer.py,v 1.1 2010-09-27 19:41:15 wirawan Exp $ +# $Id: timer.py,v 1.2 2010-09-27 19:54:26 wirawan Exp $ # # timer.py # Simple timer and possibly other timing-related routine @@ -6,6 +6,16 @@ # Wirawan Purwanto # Created: 20081022 # +# 20081022: Created as pyqmc.utils.timer . +# 20100927: Moved to wpylib.timer . +# + +""" +Simple timer utility. + +This module is part of wpylib project. +""" + import time class timer: