/[navidoc]/navidoc/navidoc/utils/path.py
ViewVC logotype

Diff of /navidoc/navidoc/utils/path.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by humppake, Tue Mar 18 16:02:27 2003 UTC revision 1.3 by humppake, Wed Mar 19 15:34:02 2003 UTC
# Line 27  __docformat__ = 'reStructuredText' Line 27  __docformat__ = 'reStructuredText'
27    
28  import os.path  import os.path
29    
30  def _rstFiles(path):  def _listdir(path, extensions, dirs=0):
31      """      """
32      Returns all ".rst" files under path. Nonrecursive.      Returns all directories and files with specific
33        extensions under path. Nonrecursive.
34      """      """
35      files = [f for f in os.listdir(_slashify(path)) \      files = [f for f in os.listdir(path) if not f.startswith('.')
36             if os.path.isfile(_slashify(path)+f) and not f.startswith('.')               and not f == "CVS" and '#' not in f and '~' not in f]
37                and '#' not in f and '~' not in f]      if not dirs:
38      rstfiles = [f for f in files if f.endswith('.rst')]          files = [f for f in os.listdir(path) if os.path.isfile(_slashify(path)+f)]
39      return rstfiles      files = [f for f in files if extensions.count(f.split('.')[-1]) > 0]
40        return files
41    
42  def _slashify(path):  def _slashify(path):
43      """      """

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26