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

Diff of /navidoc/navidoc/util/path.py

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

revision 1.3 by humppake, Mon Jun 2 13:58:14 2003 UTC revision 1.3.2.1 by humppake, Mon Jun 30 15:30:15 2003 UTC
# Line 33  def listdir(path, extensions, dirs=0): Line 33  def listdir(path, extensions, dirs=0):
33      """      """
34      listdir(path, extensions, dirs=0)      listdir(path, extensions, dirs=0)
35    
36      Quite specialized listdir, which returns all directories and files      Quite specialized listdir, which return all directories and files
37      with specific extensions under given path. Nonrecursive.      with specific extensions under given path. Nonrecursive.
38    
39      Skipping files starting with '.' or including some of 'CVS', '#', '~'.      Skipping files starting with '.' or including some of 'CVS', '#', '~'.
# Line 52  def slashify(path): Line 52  def slashify(path):
52      """      """
53      slashify(path)      slashify(path)
54    
55      Ends path with a trailing slash, if still necessary.      End path with a trailing slash, if still necessary.
56      """      """
57      if len(path) > 0:      if len(path) > 0:
58          return (path+'/').replace('//','/')          return (path+'/').replace('//','/')
# Line 62  def relative_path(source, target): Line 62  def relative_path(source, target):
62      """      """
63      relative_path(source, target)      relative_path(source, target)
64    
65      Returns a relative filepath from the source filepath to the target      Return a relative filepath from the source filepath to the target
66      filepath.      filepath.
67      """      """
68      import config      import config
# Line 70  def relative_path(source, target): Line 70  def relative_path(source, target):
70    
71      if source == None or len(source) == 0: return target      if source == None or len(source) == 0: return target
72    
     ## Condition removed because because of docutils sending  
     # relative and absolute paths mixed.  
     #  
     # if source.startswith('../') or target.startswith('../'):  
73      source = os.path.normpath(os.path.abspath(source))      source = os.path.normpath(os.path.abspath(source))
74      target = os.path.normpath(os.path.abspath(target))      target = os.path.normpath(os.path.abspath(target))
75    

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

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