rfm2  22.0
A python-based rewrite of RenderMan for Maya
 All Classes Namespaces Files Functions Variables Pages
rfm2.utils.filepath.FilePath Class Reference
+ Inheritance diagram for rfm2.utils.filepath.FilePath:
+ Collaboration diagram for rfm2.utils.filepath.FilePath:

Public Member Functions

def __new__
 
def os_path
 
def exists
 
def join
 
def dirname
 
def basename
 
def is_writable
 
def expandvars
 

Detailed Description

A class based on unicode to handle filepaths on various OS platforms.

Extends:
    unicode

Member Function Documentation

def rfm2.utils.filepath.FilePath.__new__ (   cls,
  path 
)
Create new unicode file path in POSIX format. Windows paths will be
converted.

Arguments:
    path {str} -- a file path, in any format.
def rfm2.utils.filepath.FilePath.basename (   self)
Return the basename, i.e. '/path/to/file.ext' -> 'file.ext'

Returns:
    str -- The final segment of the path.
def rfm2.utils.filepath.FilePath.dirname (   self)
Returns the dirname of the current path (using os.path.dirname) as a
FilePath object.

Returns:
    FilePath -- the path's directory name.
def rfm2.utils.filepath.FilePath.exists (   self)
Check is the path actually exists, using os.path.

Returns:
    bool -- True if the path exists.
def rfm2.utils.filepath.FilePath.expandvars (   self)
Return a Filepath with expanded environment variables and '~'.
def rfm2.utils.filepath.FilePath.is_writable (   self)
Checks if the path is writable. The Write and Execute bits must
be enabled.

Returns:
    bool -- True is writable
def rfm2.utils.filepath.FilePath.join (   self,
  args 
)
Combine the arguments with the current path and return a new
FilePath object.

Arguments:
    *args {list} -- a list of path segments.

Returns:
    FilePath -- A new object containing the joined path.
def rfm2.utils.filepath.FilePath.os_path (   self)
return the platform-specif path, i.e. convert to windows format if
need be.

Returns:
    str -- a path formatted for the current OS.

The documentation for this class was generated from the following file: