* Update documentations.

master
wirawan 14 years ago
parent cae9cabdea
commit 4c9b5ce9f7
  1. 2
      file/.cvsignore
  2. 10
      file/file_utils.py
  3. 5
      text_tools.py
  4. 12
      timer.py

@ -0,0 +1,2 @@
*.pyc
*.pyo

@ -1,5 +1,5 @@
#!/usr/bin/python #!/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 # pyqmc.utils.file_utils module
# File-manipulation utilities # File-manipulation utilities
@ -11,6 +11,14 @@
# They are not necessarily suitable for general-purpose uses; evaluate # They are not necessarily suitable for general-purpose uses; evaluate
# your needs and see if they can them as well. # 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 bz2
import glob import glob

@ -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 # wpylib.text_tools
# Created: 20091204 # Created: 20091204
@ -105,9 +105,12 @@ def str_expand(template, params, maxiter=100):
def str_grep(S, strs): 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] return [s for s in strs if s.find(S) >= 0]
def str_igrep(S, strs): 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] return [i for (s,i) in zip(strs,xrange(len(strs))) if s.find(S) >= 0]

@ -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 # timer.py
# Simple timer and possibly other timing-related routine # Simple timer and possibly other timing-related routine
@ -6,6 +6,16 @@
# Wirawan Purwanto # Wirawan Purwanto
# Created: 20081022 # 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 import time
class timer: class timer:

Loading…
Cancel
Save