mapping#

这个模块的可以让你对 Account / Character 和 WTF 配置文件的模板进行排列组合, 然后一键将你的 配置文件应用到你的客户端中的 WTF 目录下.

class wow_wtf.exp03_wotlk.mapping.Client(dir: Path, locale: str)[source]#

代表着一个具体魔兽世界客户端. 你必须要制定这个客户端的目录. 然后就可以用各种 method 来 获取对应的 WTF 配置文件的绝对路径了.

Parameters:
  • dir – 客户端目录, 根据此目录可以定位其他的目录. 例如 “C:Program FilesWorld of Warcraft”

  • locale – 客户端语种, 例如 enUS, zhCN, zhTW 等.

property client_config: Path#

This file stores client level user interface configuration.

Example: C:\...\WTF\Config.wtf

get_account_config_cache_wtf(account: Account) Path[source]#

This file stores account level user interface configuration.

Example: C:\...\WTF\Account\MYACCOUNT\config-cache.wtf

get_account_bindings_cache_wtf(account: Account) Path[source]#

This file stores account level key bindings.

Example: C:\...\WTF\Account\MYACCOUNT\bindings-cache.wtf

get_account_macros_cache_txt(account: Account) Path[source]#

This file stores account level macro configurations.

Example: C:\...\WTF\Account\MYACCOUNT\macros-cache.txt

get_account_saved_variables(account: Account, file: str) Path[source]#

This file stores per AddOn account level saved variables.

Example: C:\...\WTF\Account\MYACCOUNT\SavedVariables\AtlasLoot.lua

get_character_config_cache_wtf(character: Character) Path[source]#

This file stores character level user interface configuration.

Example: C:\...\WTF\Account\MYACCOUNT\MyServer\Mycharacter\config-cache.wtf

get_character_chat_cache_txt(character: Character) Path[source]#

This file stores character level chat cache configuration.

Example: C:\...\WTF\Account\MYACCOUNT\MyServer\Mycharacter\chat-cache.txt

get_character_bindings_cache_wtf(character: Character) Path[source]#

This file stores character level key bindings.

Example: C:\...\WTF\Account\MYACCOUNT\MyServer\Mycharacter\bindings-cache.wtf

get_character_layout_local_txt(character: Character) Path[source]#

This file stores character level UI layout configurations.

Example: C:\...\WTF\Account\MYACCOUNT\MyServer\Mycharacter\layout-local.txt

get_character_addons_txt(character: Character) Path[source]#

This file stores character level UI AddOns enable / disable configurations.

Example: C:\...\WTF\Account\MYACCOUNT\MyServer\Mycharacter\AddOns.txt

get_character_macros_cache_txt(character: Character) Path[source]#

This file stores character level macro configurations.

Example: C:\...\WTF\Account\MYACCOUNT\MyServer\Mycharacter\macros-cache.txt

get_character_saved_variables(character: Character, file: str) Path[source]#

This file stores per AddOn character level saved variables.

Example: C:\...\WTF\Account\MYACCOUNT\MyServer\Mycharacter\SavedVariables\tlasLoot.lua

class wow_wtf.exp03_wotlk.mapping.BaseMapping(file: Path)[source]#

Mapping 是一个 Account / Character 和一个 WTF 配置文件模板的组合.

property tpl: Template#

Jinja template 对象. 它会被缓存下来以便复用.

class wow_wtf.exp03_wotlk.mapping.AccLvlMapping(file: Path, acc: Account)[source]#

Account 和一个 WTF 配置文件模板的组合.

Parameters:
classmethod make_many(accounts: Iterable[Account], file: Union[Path, Iterable[Path]])[source]#

生成多个 Account 和 WTF 配置文件模板的组合. 让你写更少的代码.

Parameters:
  • accounts – Account 对象集合.

  • file – 单个文件或是多个文件的集合.

class wow_wtf.exp03_wotlk.mapping.CharLvlMapping(file: Path, char: Character)[source]#

Character 和一个 WTF 配置文件模板的组合.

Parameters:
classmethod make_many(characters: Iterable[Character], file: Union[Path, List[Path]])[source]#

生成多个 Character 和 WTF 配置文件模板的组合. 让你写更少的代码.

Parameters:
  • characters – Character 对象集合.

  • file – 单个文件或是多个文件的集合.

wow_wtf.exp03_wotlk.mapping.apply(path: Path, content: str, real_run: bool = False, verbose: bool = True)[source]#

Apply a content to a file (Write to the file in World of Warcraft\WTF\...).

Parameters:
  • path – The file path to write to.

  • content – The content to write.

  • real_run – If True, do not write to the file.

  • verbose – If True, print log.

class wow_wtf.exp03_wotlk.mapping.WtfMapping(client: ~wow_wtf.exp03_wotlk.mapping.Client, all_accounts: ~typing.Iterable[~wow_acc.model.Account], all_characters: ~typing.Iterable[~wow_acc.model.Character], client_config: ~pathlib_mate.pathlib2.Path, acc_user_interface: ~typing.List[~wow_wtf.exp03_wotlk.mapping.AccLvlMapping] = <factory>, acc_macros: ~typing.List[~wow_wtf.exp03_wotlk.mapping.AccLvlMapping] = <factory>, acc_saved_variables: ~typing.List[~wow_wtf.exp03_wotlk.mapping.AccLvlMapping] = <factory>, char_user_interface: ~typing.List[~wow_wtf.exp03_wotlk.mapping.CharLvlMapping] = <factory>, char_chat: ~typing.List[~wow_wtf.exp03_wotlk.mapping.CharLvlMapping] = <factory>, char_keybinding: ~typing.List[~wow_wtf.exp03_wotlk.mapping.CharLvlMapping] = <factory>, char_layout: ~typing.List[~wow_wtf.exp03_wotlk.mapping.CharLvlMapping] = <factory>, char_addons: ~typing.List[~wow_wtf.exp03_wotlk.mapping.CharLvlMapping] = <factory>, char_macros: ~typing.List[~wow_wtf.exp03_wotlk.mapping.CharLvlMapping] = <factory>, char_saved_variables: ~typing.List[~wow_wtf.exp03_wotlk.mapping.CharLvlMapping] = <factory>)[source]#

定义了一个魔兽世界客户端中被管理的所有 WTF 配置文件的设定.

Parameters:
apply_client_config(real_run: bool = False)[source]#

将配置文件写入到 Client.client_config().

apply_account_user_interface(real_run: bool = False)[source]#

将配置文件写入到 Client.get_account_config_cache_wtf().

apply_account_macros(real_run: bool = False)[source]#

将配置文件写入到 Client.get_account_macros_cache_txt().

apply_account_saved_variables(real_run: bool = False)[source]#

将配置文件写入到 Client.get_account_saved_variables().

apply_character_user_interface(real_run: bool = False)[source]#

将配置文件写入到 Client.get_character_config_cache_wtf().

apply_character_chat(real_run: bool = False)[source]#

将配置文件写入到 Client.get_character_chat_cache_txt().

apply_character_keybinding(real_run: bool = False)[source]#

将配置文件写入到 Client.get_character_bindings_cache_wtf().

apply_character_layout(real_run: bool = False)[source]#

将配置文件写入到 Client.get_character_layout_local_txt().

apply_character_addons(real_run: bool = False)[source]#

将配置文件写入到 Client.get_character_addons_txt().

apply_character_macros(real_run: bool = False)[source]#

将配置文件写入到 Client.get_character_macros_cache_txt().

apply_character_saved_variables(real_run: bool = False)[source]#

将配置文件写入到 Client.get_character_saved_variables().