apptools.persistence.file_path module

Simple class to support file path objects that work well in the context of persistent storage with the state_pickler.

class apptools.persistence.file_path.FilePath(value='')[source]

Bases: object

This class stores two paths to the file. A relative path and an absolute one. The absolute path is used by the end user. When this object is pickled the state_pickler sets the relative path relative to the file that is being generated. When unpickled, the stored relative path is used to set the absolute path correctly based on the path of the saved file.

get()[source]

Get the path.

set(value)[source]

Sets the value of the path.

set_absolute(base_f_name)[source]

Sets the absolute file name for the current relative file name with respect to the given base_f_name.

set_relative(base_f_name)[source]

Sets the path relative to base_f_name. Note that base_f_name and self.rel_pth should be valid file names correct on the current os. The set name is a file name that has a POSIX path.