/[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.6 by humppake, Wed Mar 26 15:36:17 2003 UTC revision 1.7 by humppake, Fri Mar 28 13:08:57 2003 UTC
# Line 29  __docformat__ = 'reStructuredText' Line 29  __docformat__ = 'reStructuredText'
29    
30  import os.path  import os.path
31    
32  def _listdir(path, extensions, dirs=0):  def listdir(path, extensions, dirs=0):
33      """      """
34      Returns all directories and files with specific      Returns all directories and files with specific
35      extensions under path. Nonrecursive.      extensions under path. Nonrecursive.
# Line 38  def _listdir(path, extensions, dirs=0): Line 38  def _listdir(path, extensions, dirs=0):
38               and not f == 'CVS' and '#' not in f and '~' not in f]               and not f == 'CVS' and '#' not in f and '~' not in f]
39    
40      files = [f for f in files if extensions.count(f.split('.')[-1]) > 0 \      files = [f for f in files if extensions.count(f.split('.')[-1]) > 0 \
41               or os.path.isdir(_slashify(path)+f)]               or os.path.isdir(slashify(path)+f)]
42      if not dirs:      if not dirs:
43          files = [f for f in files if os.path.isfile(_slashify(path)+f)]          files = [f for f in files if os.path.isfile(slashify(path)+f)]
44      return files      return files
45    
46  def _slashify(path):  def slashify(path):
47      """      """
48      Add a trailing slash if not already there.      Add a trailing slash if not already there.
49      """      """

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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