##// END OF EJS Templates
Simplify ifile: Remove all methods that call the base...
walter.doerwald -
Show More
@@ -844,136 +844,6 b' class ifile(path.path):'
844 file (or directory) object.
844 file (or directory) object.
845 """
845 """
846
846
847 def __add_(self, other):
848 return ifile(path._base(self) + other)
849
850 def __radd_(self, other):
851 return ifile(other + path._base(self))
852
853 def __div_(self, other):
854 return ifile(path.__div__(self, other))
855
856 def getcwd():
857 return ifile(path.path.getcwd())
858 getcwd.__doc__ = path.path.getcwd.__doc__
859 getcwd = staticmethod(getcwd)
860
861 def abspath(self):
862 return ifile(path.path.abspath(self))
863 abspath.__doc__ = path.path.abspath.__doc__
864
865 def normcase(self):
866 return ifile(path.path.normcase(self))
867 normcase.__doc__ = path.path.normcase.__doc__
868
869 def normpath(self):
870 return ifile(path.path.normpath(self))
871 normpath.__doc__ = path.path.normpath.__doc__
872
873 def realpath(self):
874 return ifile(path.path.realpath(self))
875 realpath.__doc__ = path.path.realpath.__doc__
876
877 def expanduser(self):
878 return ifile(path.path.expanduser(self))
879 expanduser.__doc__ = path.path.expanduser.__doc__
880
881 def expandvars(self):
882 return ifile(path.path.expandvars(self))
883 expandvars.__doc__ = path.path.expandvars.__doc__
884
885 def dirname(self):
886 return ifile(path.path.dirname(self))
887 dirname.__doc__ = path.path.dirname.__doc__
888
889 parent = property(dirname, None, None, path.path.parent.__doc__)
890
891 def splitpath(self):
892 (parent, child) = path.path.splitpath(self)
893 return (ifile(parent), child)
894 splitpath.__doc__ = path.path.splitpath.__doc__
895
896 def splitdrive(self):
897 (drive, rel) = path.path.splitdrive(self)
898 return (ifile(drive), rel)
899 splitdrive.__doc__ = path.path.splitdrive.__doc__
900
901 def splitext(self):
902 (filename, ext) = path.path.splitext(self)
903 return (ifile(filename), ext)
904 splitext.__doc__ = path.path.splitext.__doc__
905
906 if hasattr(path.path, "splitunc"):
907 def splitunc(self):
908 (unc, rest) = path.path.splitunc(self)
909 return (ifile(unc), rest)
910 splitunc.__doc__ = path.path.splitunc.__doc__
911
912 def _get_uncshare(self):
913 unc, r = os.path.splitunc(self)
914 return ifile(unc)
915
916 uncshare = property(
917 _get_uncshare, None, None,
918 """ The UNC mount point for this path.
919 This is empty for paths on local drives. """)
920
921 def joinpath(self, *args):
922 return ifile(path.path.joinpath(self, *args))
923 joinpath.__doc__ = path.path.joinpath.__doc__
924
925 def splitall(self):
926 return map(ifile, path.path.splitall(self))
927 splitall.__doc__ = path.path.splitall.__doc__
928
929 def relpath(self):
930 return ifile(path.path.relpath(self))
931 relpath.__doc__ = path.path.relpath.__doc__
932
933 def relpathto(self, dest):
934 return ifile(path.path.relpathto(self, dest))
935 relpathto.__doc__ = path.path.relpathto.__doc__
936
937 def listdir(self, pattern=None):
938 return [ifile(child) for child in path.path.listdir(self, pattern)]
939 listdir.__doc__ = path.path.listdir.__doc__
940
941 def dirs(self, pattern=None):
942 return [ifile(child) for child in path.path.dirs(self, pattern)]
943 dirs.__doc__ = path.path.dirs.__doc__
944
945 def files(self, pattern=None):
946 return [ifile(child) for child in path.path.files(self, pattern)]
947 files.__doc__ = path.path.files.__doc__
948
949 def walk(self, pattern=None):
950 for child in path.path.walk(self, pattern):
951 yield ifile(child)
952 walk.__doc__ = path.path.walk.__doc__
953
954 def walkdirs(self, pattern=None):
955 for child in path.path.walkdirs(self, pattern):
956 yield ifile(child)
957 walkdirs.__doc__ = path.path.walkdirs.__doc__
958
959 def walkfiles(self, pattern=None):
960 for child in path.path.walkfiles(self, pattern):
961 yield ifile(child)
962 walkfiles.__doc__ = path.path.walkfiles.__doc__
963
964 def glob(self, pattern):
965 return map(ifile, path.path.glob(self, pattern))
966 glob.__doc__ = path.path.glob.__doc__
967
968 if hasattr(os, 'readlink'):
969 def readlink(self):
970 return ifile(path.path.readlink(self))
971 readlink.__doc__ = path.path.readlink.__doc__
972
973 def readlinkabs(self):
974 return ifile(path.path.readlinkabs(self))
975 readlinkabs.__doc__ = path.path.readlinkabs.__doc__
976
977 def getmode(self):
847 def getmode(self):
978 return self.stat().st_mode
848 return self.stat().st_mode
979 mode = property(getmode, None, None, "Access mode")
849 mode = property(getmode, None, None, "Access mode")
@@ -1,3 +1,9 b''
1 2006-10-23 Walter Doerwald <walter@livinglogic.de>
2
3 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
4 call the base class method and propagate the return value to
5 ifile. This is now done by path itself.
6
1 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
7 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2
8
3 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
9 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
General Comments 0
You need to be logged in to leave comments. Login now