AbjadConfiguration

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=1]; "abjad.system.AbjadConfiguration.AbjadConfiguration" [URL="../api/abjad/system/AbjadConfiguration.html#abjad.system.AbjadConfiguration.AbjadConfiguration", color=black, fontcolor=white, label="Abjad\nConfiguration", target=_top]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.Configuration.Configuration" [URL="../api/abjad/system/Configuration.html#abjad.system.Configuration.Configuration", label=Configuration, shape=oval, style=bold, target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.Configuration.Configuration"; "abjad.system.Configuration.Configuration" -> "abjad.system.AbjadConfiguration.AbjadConfiguration"; } subgraph cluster_builtins { graph [label=builtins]; node [color=2]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.system.AbjadConfiguration.AbjadConfiguration

Abjad configuration.

>>> abjad_configuration = abjad.AbjadConfiguration()

Behavior at instantiation:

  • Looks for $HOME/.abjad/.
  • Creates $HOME/.abjad/ if directory does not exist.
  • Looks for $HOME/.abjad/abjad.cfg.
  • Creates $HOME/.abjad/abjad.cfg if file does not exist.
  • Parses $HOME/.abjad/abjad.cfg.
  • Provides default key-value pairs for pairs which fail validation.
  • Writes configuration changes to disk.
  • Creates Abjad output directory if directory does not exist.

Supports mutable mapping dictionary interface.


Attributes Summary

abjad_directory Gets Abjad directory.
abjad_output_directory Gets Abjad output directory.
abjad_root_directory Gets Abjad root directory.
boilerplate_directory Gets Abjad boilerplate directory.
composer_email Gets composer email.
composer_full_name Gets composer full name.
composer_github_username Gets GitHub username.
composer_last_name Gets composer last name.
composer_library Gets composer library package name.
composer_library_tools Gets composer library tools directory.
composer_scores_directory Gets composer scores directory.
composer_uppercase_name Gets composer uppercase name.
composer_website Gets composer website.
get_abjad_startup_string Gets Abjad startup string.
get_abjad_version_string Gets Abjad version string.
get_lilypond_minimum_version_string Gets LilyPond minimum version string.
get_lilypond_version_string Gets LilyPond version string.
get_python_version_string Gets Python version string.
get_tab_width Gets tab width.
get_text_editor Gets text editor.
lilypond_log_file_path Gets LilyPond log file path.
list_package_dependency_versions Lists package dependency versions.

Special methods

(Configuration).__delitem__(i)

Deletes item i from configuration.

Returns none.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to '' or 'storage'. Interprets '' equal to 'storage'.

Returns string.

(Configuration).__getitem__(argument)

Gets item or slice identified by argument.

Returns item or slice.

(Configuration).__iter__()

Iterates configuration settings.

Returns generator.

(Configuration).__len__()

Gets the number of settings in configuration.

Returns nonnegative integer.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

(Configuration).__setitem__(i, argument)

Sets configuration item i to argument.

Returns none.


Methods

(Configuration).get(*arguments, **keywords)

Gets a key.


Class & static methods

classmethod get_abjad_startup_string()

Gets Abjad startup string.

>>> abjad_configuration = abjad.AbjadConfiguration()
>>> abjad_configuration.get_abjad_startup_string()
'Abjad 3.0.0 (development)'

Returns string.

static get_abjad_version_string()

Gets Abjad version string.

>>> abjad_configuration = abjad.AbjadConfiguration()
>>> abjad_configuration.get_abjad_version_string()
'3.0.0'

Returns string.

classmethod get_lilypond_minimum_version_string()

Gets LilyPond minimum version string.

>>> abjad_configuration = abjad.AbjadConfiguration()
>>> abjad_configuration.get_lilypond_minimum_version_string() 
'2.19.0'

Returns string.

static get_lilypond_version_string()

Gets LilyPond version string.

>>> abjad_configuration = abjad.AbjadConfiguration()
>>> abjad_configuration.get_lilypond_version_string() 
'2.19.82'

Returns string.

static get_python_version_string()

Gets Python version string.

>>> abjad_configuration = abjad.AbjadConfiguration()
>>> abjad_configuration.get_python_version_string() 
'3.6.4'

Returns string.

static get_tab_width()

Gets tab width.

>>> abjad_configuration = abjad.AbjadConfiguration()
>>> abjad_configuration.get_tab_width()
4

Used by code generation functions.

Returns nonnegative integer.

static get_text_editor()

Gets text editor.

>>> abjad_configuration = abjad.AbjadConfiguration()
>>> abjad_configuration.get_text_editor() 
'vi'

Returns string.

static list_package_dependency_versions()

Lists package dependency versions.

>>> abjad_configuration = abjad.AbjadConfiguration()
>>> abjad_configuration.list_package_dependency_versions() 
{'sphinx': '1.1.2', 'pytest': '2.1.2'}

Returns dictionary.


Read-only properties

abjad_directory

Gets Abjad directory.

Returns string.

abjad_output_directory

Gets Abjad output directory.

Returns string.

abjad_root_directory

Gets Abjad root directory.

Returns string.

boilerplate_directory

Gets Abjad boilerplate directory.

Return string.

composer_email

Gets composer email.

Returns string.

composer_full_name

Gets composer full name.

Returns string.

composer_github_username

Gets GitHub username.

Returns string.

composer_last_name

Gets composer last name.

Returns string.

composer_library

Gets composer library package name.

Returns string.

composer_library_tools

Gets composer library tools directory.

Returns string.

composer_scores_directory

Gets composer scores directory.

Returns string.

composer_uppercase_name

Gets composer uppercase name.

>>> configuration.composer_uppercase_name 
'TREVOR BAČA'

Returns string.

composer_website

Gets composer website.

>>> configuration.composer_website  
'www.trevobaca.com'

Returns string.

(Configuration).configuration_directory

Gets configuration directory.

>>> configuration = abjad.AbjadConfiguration()
>>> configuration.configuration_directory
PosixPath('...')

Defaults to $HOME/{directory_name}.

If $HOME is read-only or $HOME/{directory_name} is read-only, returns $TEMP/{directory_name}.

Also caches the initial result to reduce filesystem interaction.

Returns path object.

(Configuration).configuration_file_path

Gets configuration file path.

>>> configuration = abjad.AbjadConfiguration()
>>> configuration.configuration_file_path
PosixPath('...')

Returns path object.

(Configuration).home_directory

Gets home directory.

>>> configuration = abjad.AbjadConfiguration()
>>> configuration.home_directory
PosixPath('...')

Returns path object.

lilypond_log_file_path

Gets LilyPond log file path.

Returns string.

(Configuration).temp_directory

Gets temp directory.

>>> configuration = abjad.AbjadConfiguration()
>>> configuration.temp_directory
PosixPath('...')

Returns path object.