Changeset 1883:c8a0a54c39f1


Ignore:
Timestamp:
Jan 1, 2020, 6:48:16 PM (3 weeks ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
histedit_source:
96b586d72dc665efeacd2a446eca2a272bc686c8
Message:
Order `posixpath` attributes alphabetically

Follow the order in the current Python documentation for `os.path` to
make the list easier to compare with the Python module.

Note that the methods we use from the `posixpath` module can only be
methods that don't need local file system access. Obviously, we need
to access files on the FTP server instead. :-)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ftputil/path.py

    r1882 r1883  
    3232    def __init__(self, host):
    3333        self._host = host
    34         # Delegate these to the `posixpath` module.
     34        # Delegate these methods to the `posixpath` module because they don't
     35        # need file system access but work on the path strings (possibly
     36        # extracted from `PathLike` objects).
    3537        # pylint: disable=invalid-name
    3638        pp = posixpath
     39        self.basename = pp.basename
     40        self.commonprefix = pp.commonprefix
    3741        self.dirname = pp.dirname
    38         self.basename = pp.basename
    3942        self.isabs = pp.isabs
    40         self.commonprefix = pp.commonprefix
     43        self.join = pp.join
     44        self.normcase = pp.normcase
     45        self.normpath = pp.normpath
    4146        self.split = pp.split
    4247        self.splitdrive = pp.splitdrive
    4348        self.splitext = pp.splitext
    44         self.normcase = pp.normcase
    45         self.normpath = pp.normpath
    46         self.join = pp.join
    4749
    4850    def abspath(self, path):
Note: See TracChangeset for help on using the changeset viewer.