Show More
@@ -10,7 +10,7 for f in d.files('*.py'): | |||
|
10 | 10 | This module requires Python 2.5 or later. |
|
11 | 11 | |
|
12 | 12 | |
|
13 | URL: http://www.jorendorff.com/articles/python/path | |
|
13 | URL: http://pypi.python.org/pypi/path.py | |
|
14 | 14 | Author: Jason Orendorff <jason.orendorff\x40gmail\x2ecom> (and others - see the url!) |
|
15 | 15 | Date: 9 Mar 2007 |
|
16 | 16 | """ |
@@ -99,7 +99,7 class path(unicode): | |||
|
99 | 99 | |
|
100 | 100 | # --- Operations on path strings. |
|
101 | 101 | |
|
102 |
isabs |
|
|
102 | def isabs(s): return os.path.isabs(s) | |
|
103 | 103 | def abspath(self): return self.__class__(os.path.abspath(self)) |
|
104 | 104 | def normcase(self): return self.__class__(os.path.normcase(self)) |
|
105 | 105 | def normpath(self): return self.__class__(os.path.normpath(self)) |
@@ -107,7 +107,7 class path(unicode): | |||
|
107 | 107 | def expanduser(self): return self.__class__(os.path.expanduser(self)) |
|
108 | 108 | def expandvars(self): return self.__class__(os.path.expandvars(self)) |
|
109 | 109 | def dirname(self): return self.__class__(os.path.dirname(self)) |
|
110 |
basename |
|
|
110 | def basename(s): return os.path.basename(s) | |
|
111 | 111 | |
|
112 | 112 | def expand(self): |
|
113 | 113 | """ Clean up a filename by calling expandvars(), |
@@ -752,33 +752,36 class path(unicode): | |||
|
752 | 752 | return m.digest() |
|
753 | 753 | |
|
754 | 754 | # --- Methods for querying the filesystem. |
|
755 | # N.B. We can't assign the functions directly, because they may on some | |
|
756 | # platforms be implemented in C, and compiled functions don't get bound. | |
|
757 | # See gh-737 for discussion of this. | |
|
755 | 758 | |
|
756 |
exists |
|
|
757 |
isdir |
|
|
758 |
isfile |
|
|
759 |
islink |
|
|
760 |
ismount |
|
|
759 | def exists(s): return os.path.exists(s) | |
|
760 | def isdir(s): return os.path.isdir(s) | |
|
761 | def isfile(s): return os.path.isfile(s) | |
|
762 | def islink(s): return os.path.islink(s) | |
|
763 | def ismount(s): return os.path.ismount(s) | |
|
761 | 764 | |
|
762 | 765 | if hasattr(os.path, 'samefile'): |
|
763 |
samefile |
|
|
766 | def samefile(s, o): return os.path.samefile(s, o) | |
|
764 | 767 | |
|
765 |
getatime |
|
|
768 | def getatime(s): return os.path.getatime(s) | |
|
766 | 769 | atime = property( |
|
767 | 770 | getatime, None, None, |
|
768 | 771 | """ Last access time of the file. """) |
|
769 | 772 | |
|
770 |
getmtime |
|
|
773 | def getmtime(s): return os.path.getmtime(s) | |
|
771 | 774 | mtime = property( |
|
772 | 775 | getmtime, None, None, |
|
773 | 776 | """ Last-modified time of the file. """) |
|
774 | 777 | |
|
775 | 778 | if hasattr(os.path, 'getctime'): |
|
776 |
getctime |
|
|
779 | def getctime(s): return os.path.getctime(s) | |
|
777 | 780 | ctime = property( |
|
778 | 781 | getctime, None, None, |
|
779 | 782 | """ Creation time of the file. """) |
|
780 | 783 | |
|
781 |
getsize |
|
|
784 | def getsize(s): return os.path.getsize(s) | |
|
782 | 785 | size = property( |
|
783 | 786 | getsize, None, None, |
|
784 | 787 | """ Size of the file, in bytes. """) |
General Comments 0
You need to be logged in to leave comments.
Login now