Manual:Pywikibot/user-config.py/ja

設定
プログラムを実行する前に、 ディレクトリに   という名前のファイルを作成する必要があります. 次のいずれかの方法で作成します


 * 1) 手動でファイルを作成する 少なくとも2つまたは3つの変数を設定し、正しい位置に置く必要があります.
 * 2) コマンドシェルに python pwb.py generate_user_files.py を入力してスクリプト   を実行し、対話型のウィザードでファイルが生成され、デフォルトの領域に保存されます.

場所
Pywikibotは以下の場所で順番に を探します.


 * Specified via the  argument (for example:  )
 * The content of the environment variable
 * The current directory
 * The directory in which the  file is
 * The  directory in the application data directory (Windows) or home directory (that directory gets automatically created)

(See also: .)

Below are instructions for manually editing this file.

For Wikimedia projects
Open a text editor (e.g. Notepad in Windows) and save the text file as  in the   folder.

If your language uses non-ASCII characters, you should use a Unicode-aware editor such as Notepad++ and save your user-config with Unicode encoding without BOM marks. Don't forget to insert

as the first line.

Add the following lines to :

Now save  again.

EksempelBot on no.wikipedia
mylang = 'no' usernames['wikipedia']['no'] = 'EksempelBot'

console_encoding = 'utf-8' use_api_login = True

ExampleBot on Commons
mylang = 'commons' family = 'commons' usernames['commons']['commons'] = 'ExampleBot'

console_encoding = 'utf-8' use_api_login = True

ExampleBot on Wikidata
mylang = 'wikidata' family = 'wikidata' usernames['wikidata']['wikidata'] = 'ExampleBot'

console_encoding = 'utf-8' use_api_login = True

ExampleBot on Test wiki
mylang = 'test' family = 'test' usernames['test']['test'] = 'ExampleBot'

ExampleBot on Test2 wiki
mylang = 'test2' family = 'wikipedia' usernames['wikipedia']['test2'] = 'ExampleBot'

BeispielBot on de.wikipedia and de.wikibooks, with de.wikipedia as main wiki
mylang = 'de' usernames['wikipedia']['de'] = 'BeispielBot' usernames['wikibooks']['de'] = 'BeispielBot'

console_encoding = 'utf-8' use_api_login = True

For non-Wikimedia wikis

 * See main page Pywikibot/Use on third-party wikis



関連項目

 * config.py (the source code of the module that loads and interpretes user-config.py)