Skip to content

Special Variables

A number of special variables exist for using within tackle files to gain access to common things.

Directories and Files

  • cwd - Current working directory
  • home_dir - Home directory
  • calling_directory - The directory tackle was called from
  • calling_file - The path to the tackle file that was first called
  • current_directory - The directory of the file being parsed
  • current_file - The path to the current file being parsed
  • tackle_dir - Directory where tackle config is, defaults to ~/.config/tackle
  • providers_dir - Directory where tackle providers are, defaults to ~/.config/tackle/providers
  • xdg_config_dirs - XDG config dirs- ie ~/.config on linux - the base of the tackle dir
  • xdg_cache_home - XDG cache dir
  • xdg_config_home - XDG config home
  • xdg_data_dirs - XDG data dirs
  • xdg_data_home - XDG data dir
  • xdg_runtime_dir - XDG runtime dir
  • xdg_state_home - XDG state home

System Properties

  • system - OS (ie Darwin, Linux, Windows). Same as python's platform.system()
  • platform - OS with kernel, ie Linux-5.8.0-45-generic-x86_64-with-glibc2.29
  • version - Kernel's release, ie #51~20.04.1-Ubuntu SMP Tue Feb 23 13:46:31 UTC 2021
  • processor - Processor architecture, ie x86_64. Same as platform.processor()
  • architecture - Further architecture info, ie ('64bit', 'ELF')
  • lsb_release - Same as linux's lsb_release, ie Ubuntu 20.04.4 LTS (Focal Fossa)

Tackle Internals

See memory management docs for more details on the differences between contexts.

  • this - The public context from normal keys and hooks called with ->
  • public_context - The public context from normal keys and hooks called with ->
  • private_context - The private context from hooks called with _>
  • existing_context - The existing context passed into blocks
  • temporary_context - The temporary context when parsing blocks
  • key_path - A list of keys to identify position in document
  • key_path_block - Same as key path but normalized for being within a block