@@ -2695,48 +2695,11 @@ def flat(x):
2695
2695
yield a
2696
2696
2697
2697
2698
- def abspath (filename ):
2699
- """Return a normalized absolute version of a file name.
2698
+ def abspath (path , uri = None ):
2699
+ return cfdm . abspath ( path , uri = uri )
2700
2700
2701
- If `None` or a string containing URL is provided then it is
2702
- returned unchanged.
2703
2701
2704
- .. seealso:: `cf.dirname`, `cf.pathjoin`, `cf.relpath`
2705
-
2706
- :Parameters:
2707
-
2708
- filename: `str` or `None`
2709
- The name of the file, or `None`
2710
-
2711
- :Returns:
2712
-
2713
- `str`
2714
-
2715
- The normalized absolutised version of *filename*, or
2716
- `None`.
2717
-
2718
- **Examples**
2719
-
2720
- >>> import os
2721
- >>> os.getcwd()
2722
- '/data/archive'
2723
- >>> cf.abspath('file.nc')
2724
- '/data/archive/file.nc'
2725
- >>> cf.abspath('..//archive///file.nc')
2726
- '/data/archive/file.nc'
2727
- >>> cf.abspath('http://data/archive/file.nc')
2728
- 'http://data/archive/file.nc'
2729
-
2730
- """
2731
- u = urlparse (filename )
2732
- scheme = u .scheme
2733
- if not scheme :
2734
- return _os_path_abspath (filename )
2735
-
2736
- if scheme == "file" :
2737
- return u .path
2738
-
2739
- return filename
2702
+ abspath .__doc__ = cfdm .abspath .__doc__ .replace ("cfdm." , "cf." )
2740
2703
2741
2704
2742
2705
def relpath (filename , start = None ):
@@ -2783,8 +2746,10 @@ def relpath(filename, start=None):
2783
2746
return _os_path_relpath (filename )
2784
2747
2785
2748
2786
- def dirname (path , isdir = False ):
2787
- return cfdm .dirname (path , isdir = isdir )
2749
+ def dirname (path , normalise = False , uri = None , isdir = False , sep = False ):
2750
+ return cfdm .dirname (
2751
+ path , normalise = normalise , uri = uri , isdir = isdir , sep = sep
2752
+ )
2788
2753
2789
2754
2790
2755
dirname .__doc__ = cfdm .dirname .__doc__ .replace ("cfdm." , "cf." )
0 commit comments