Object Path module for Python release 0.1 by Jens Peter Grosen www.grosen.dk/py/op.html
Use at your own risk. :-)
Sourcecode: plaintext, highlighted
op.dirpath
Methods: (_findinclude_, cmp, copy, empty, isdir, list, listall, listallonlydirs, listallonlyfiles, listonlydirs, listonlyfiles, makedirs, remove, size)
- method _findinclude_ (find, p)
op.dirpath._findinclude_
- method cmp (to, *args)
op.dirpath.cmp
- method copy (to, *args)
op.dirpath.copy
- method empty (*args, **kv)
op.dirpath.empty
- method isdir ()
op.dirpath.isdir
op.dirpath.list
- method listall (find=None) like list but includes subdirectories
op.dirpath.listall
op.dirpath.listallonlydirs
op.dirpath.listallonlyfiles
- method listonlydirs (find=None) return a list of op.path for each of the directorys in self
op.dirpath.listonlydirs
- method listonlyfiles (find=None) return a list of op.path for each of the files in self
op.dirpath.listonlyfiles
- method makedirs (to) make one or more new directorys from self and returns a new path to it
op.dirpath.makedirs
- method remove (*args, **kv)
op.dirpath.remove
- method size ()
op.dirpath.size
op.filepath
Methods: (cmp, copy, dir, empty, isfile, read, readlines, remove, size, write, writelines)
- method cmp (to, *args)
op.filepath.cmp
- method copy (to)
op.filepath.copy
- method dir ()
op.filepath.dir
- method empty () removes the contents of the file
op.filepath.empty
- method isfile ()
op.filepath.isfile
- method read () opens the file, read it and closes it
op.filepath.read
- method readlines () opens the file, readlines it and closes it
op.filepath.readlines
- method remove (*args, **kv)
op.filepath.remove
- method size ()
op.filepath.size
- method write (data) opens the file, appends to it and closes it
op.filepath.write
- method writelines (lines) opens the file, appends the lines to it and closes it
op.filepath.writelines
general path is used when the path is not a filepath or dirpath e.g. empty paths \"\
op.generalpath
Methods: (__cmp__, __hash__, __init__, __repr__, __str__, cmp, copy, ext, isdir, isfile, name, namenoext, path, remove, size, str)
- method __cmp__ (other)
op.generalpath.__cmp__
- method __hash__ ()
op.generalpath.__hash__
- method __init__ (path="")
op.generalpath.__init__
- method __repr__ ()
op.generalpath.__repr__
- method __str__ ()
op.generalpath.__str__
- method cmp (to, *args) return 1 if the two files or directorys are binary equal
op.generalpath.cmp
- method copy (to)
op.generalpath.copy
- method ext () return only the extension e.g. \".txt\" from name.txt
op.generalpath.ext
- method isdir () retruns 1 if the path is a directory
op.generalpath.isdir
- method isfile () returns 1 if the path is a file
op.generalpath.isfile
- method name ()
op.generalpath.name
- method namenoext ()
op.generalpath.namenoext
- method path (*args) returns a new path, like op.path(self, args)
op.generalpath.path
- method remove (*args, **kv) deletes the file or dir(incl subdirs) from the filesystem
op.generalpath.remove
- method size () returns the size of the directory or file
op.generalpath.size
- method str () returns the path as a string
op.generalpath.str
op.bindircmp
op.binfilecmp
op.dirremove
creates a new directory and returns a dirpath to it
op.newdir
creates a new file, closes it and returns a filepath to it
op.newfile
makes a new filepath, dirpath or generalpath if no file/dir was found
op.path
unittest for op to run the unittest you have to set localpath just below
Sourcecode: plaintext, highlighted
optester.Global
optester.PathTester
Methods: (setUp, testIsfileAndisdir, testcmpdir, testcmpfile, testcopydir, testcreatecompare, testempty, testlist, testlistall, testlistconctraint, testlistonlydirs, testlistonlyfiles, testmakeremovedir, testmakeremovesubdir, testname, testnewtempfiles, testpath, testprintto, testreadlinesondir, testreadlineswithopenfile, testreadwrite, testreallines, testsize, testsizeofdir, teststringcompat)
- method setUp ()
optester.PathTester.setUp
- method testIsfileAndisdir ()
optester.PathTester.testIsfileAndisdir
- method testcmpdir ()
optester.PathTester.testcmpdir
- method testcmpfile ()
optester.PathTester.testcmpfile
- method testcopydir ()
optester.PathTester.testcopydir
- method testcreatecompare ()
optester.PathTester.testcreatecompare
- method testempty ()
optester.PathTester.testempty
- method testlist ()
optester.PathTester.testlist
- method testlistall ()
optester.PathTester.testlistall
- method testlistconctraint ()
optester.PathTester.testlistconctraint
- method testlistonlydirs ()
optester.PathTester.testlistonlydirs
- method testlistonlyfiles ()
optester.PathTester.testlistonlyfiles
- method testmakeremovedir ()
optester.PathTester.testmakeremovedir
- method testmakeremovesubdir ()
optester.PathTester.testmakeremovesubdir
- method testname ()
optester.PathTester.testname
- method testnewtempfiles ()
optester.PathTester.testnewtempfiles
- method testpath ()
optester.PathTester.testpath
- method testprintto ()
optester.PathTester.testprintto
- method testreadlinesondir ()
optester.PathTester.testreadlinesondir
- method testreadlineswithopenfile ()
optester.PathTester.testreadlineswithopenfile
- method testreadwrite ()
optester.PathTester.testreadwrite
- method testreallines ()
optester.PathTester.testreallines
- method testsize ()
optester.PathTester.testsize
- method testsizeofdir ()
optester.PathTester.testsizeofdir
- method teststringcompat ()
optester.PathTester.teststringcompat
Created by Doc-Tool V0.9.1 on Wed Aug 08 21:15:17 2001