ConfigVariableFilename

from acron.core import ConfigVariableFilename
class ConfigVariableFilename

Bases:

Bases: ConfigVariable

This is a convenience class to specialize ConfigVariable as a Filename type. It is almost the same thing as ConfigVariableString, except it handles an implicit Filename.expand_from() operation so that the user may put OS-specific filenames, or filenames based on environment variables, in the prc file.

Inheritance diagram

digraph inheritance3c9dbe0966 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "ConfigFlags" [URL="acron.core.ConfigFlags.html#acron.core.ConfigFlags",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ConfigFlags" [arrowsize=0.75,style=""]; "ConfigVariable" [URL="acron.core.ConfigVariable.html#acron.core.ConfigVariable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ConfigVariableBase" -> "ConfigVariable" [arrowsize=0.75,style=""]; "ConfigVariableBase" [URL="acron.core.ConfigVariableBase.html#acron.core.ConfigVariableBase",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ConfigFlags" -> "ConfigVariableBase" [arrowsize=0.75,style=""]; "ConfigVariableFilename" [URL="acron.core.ConfigVariableFilename.html#acron.core.ConfigVariableFilename",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ConfigVariable" -> "ConfigVariableFilename" [arrowsize=0.75,style=""]; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; }
__bool__()

Returns true if the variable is not empty.

__eq__()

Comparison operators are handy.

__fspath__()

Allows a ConfigVariableFilename object to be passed to any Python function that accepts an os.PathLike object.

Added in version 1.10.13.

__getitem__()
__init__()
__lt__()
__ne__()
assign()
c_str()

These methods help the ConfigVariableFilename act like a Filename object.

property default_value → Filename

Returns the variable’s default value.

empty()
get_basename()

Returns the basename part of the filename. This is everything in the filename after the rightmost slash, including any extensions.

get_basename_wo_extension()

Returns the basename part of the filename, without the file extension.

get_default_value()

Returns the variable’s default value.

get_dirname()

Returns the directory part of the filename. This is everything in the filename up to, but not including the rightmost slash.

get_extension()

Returns the file extension. This is everything after the rightmost dot, if there is one, or the empty string if there is not.

get_fullpath()

Returns the entire filename: directory, basename, extension. This is the same thing returned by the string typecast operator, so this function is a little redundant.

get_fullpath_wo_extension()

Returns the full filename–directory and basename parts–except for the extension.

get_value()

Returns the variable’s value.

get_word()

Returns the variable’s nth value.

length()
set_value()

Reassigns the variable’s local value.

set_word()

Reassigns the variable’s nth value. This makes a local copy of the variable’s overall value.

property value → Filename
Getter

Returns the variable’s value.

Setter

Reassigns the variable’s local value.