/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Lib/fileutil.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Lib/fileutil.py

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

revision 338 by bh, Tue Aug 28 15:41:52 2001 UTC revision 339 by bh, Fri Sep 20 17:27:36 2002 UTC
# Line 1  Line 1 
1  # Copyright (c) 2001 by Intevation GmbH  # Copyright (c) 2001, 2002 by Intevation GmbH
2  # Authors:  # Authors:
3  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
4  #  #
# Line 77  def relative_filename_posix(dir, absname Line 77  def relative_filename_posix(dir, absname
77      # for that to faciliate testing      # for that to faciliate testing
78      import posixpath      import posixpath
79      if not posixpath.isabs(absname):      if not posixpath.isabs(absname):
80          return absname          return absname
81    
82      if not posixpath.isabs(dir):      if not posixpath.isabs(dir):
83          raise TypeError("first argument must be an absolute filename")          raise TypeError("first argument must be an absolute filename")
# Line 138  def relative_filename_nt(dir, absname): Line 138  def relative_filename_nt(dir, absname):
138    
139      # handle some special cases      # handle some special cases
140      if not ntpath.isabs(absname_rest):      if not ntpath.isabs(absname_rest):
141          return absname          return absname
142    
143      if dir_drive != absname_drive:      if dir_drive != absname_drive:
144          return absname          return absname
# Line 149  def relative_filename_nt(dir, absname): Line 149  def relative_filename_nt(dir, absname):
149      return relative_filename_common(dir_rest, absname_rest, "\\")      return relative_filename_common(dir_rest, absname_rest, "\\")
150    
151    
152  # bind the appriate version of relative_filename for the platform we're  # bind the appropriate version of relative_filename for the platform
153  # currently running on.  # we're currently running on.
154  if os.name == "posix":  if os.name == "posix":
155      relative_filename = relative_filename_posix      relative_filename = relative_filename_posix
156  elif os.name == "nt":  elif os.name == "nt":

Legend:
Removed from v.338  
changed lines
  Added in v.339

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26