Urbanecm

user-config.py

Dec 4th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.66 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. from __future__ import absolute_import, unicode_literals
  3.  
  4. # This is an automatically generated file. You can find more configuration
  5. # parameters in 'config.py' file.
  6.  
  7. # The family of sites to work on by default.
  8. #
  9. # ‘site.py’ imports ‘families/xxx_family.py’, so if you want to change
  10. # this variable, you need to use the name of one of the existing family files
  11. # in that folder or write your own, custom family file.
  12. #
  13. # For ‘site.py’ to be able to read your custom family file, you must
  14. # save it to ‘families/xxx_family.py’, where ‘xxx‘ is the codename of the
  15. # family that your custom ‘xxx_family.py’ family file defines.
  16. #
  17. # You can also save your custom family files to a different folder. As long
  18. # as you follow the ‘xxx_family.py’ naming convention, you can register your
  19. # custom folder in this configuration file with the following global function:
  20. #
  21. # register_families_folder(folder_path)
  22. #
  23. # Alternatively, you can register particular family files that do not need
  24. # to follow the ‘xxx_family.py’ naming convention using the following
  25. # global function:
  26. #
  27. # register_family_file(family_name, file_path)
  28. #
  29. # Where ‘family_name’ is the family code (the ‘xxx’ in standard family file
  30. # names) and ‘file_path’ is the absolute path to the target family file.
  31. #
  32. # If you use either of these functions to define the family to work on by
  33. # default (the ‘family’ variable below), you must place the function call
  34. # before the definition of the ‘family’ variable.
  35. family = 'wikipedia'
  36.  
  37. # The language code of the site we're working on.
  38. mylang = 'cs'
  39.  
  40. # The dictionary usernames should contain a username for each site where you
  41. # have a bot account. If you have a unique username for all languages of a
  42. # family , you can use '*'
  43. usernames['wikidata']['wikidata'] = u'UrbanecmBot'
  44. usernames['wikipedia']['cs'] = u'UrbanecmBot'
  45. authenticate['*'] = ('CENSORED','CENSORED', 'CENSORED', 'CENSORED')
  46.  
  47. # ############# LOGFILE SETTINGS ##############
  48.  
  49. # Defines for which scripts a logfile should be enabled. Logfiles will be
  50. # saved in the 'logs' subdirectory.
  51. # Example:
  52. # log = ['interwiki', 'weblinkchecker', 'table2wiki']
  53. # It is also possible to enable logging for all scripts, using this line:
  54. # log = ['*']
  55. # To disable all logging, use this:
  56. # log = []
  57. # Per default, logging of interwiki.py is enabled because its logfiles can
  58. # be used to generate so-called warnfiles.
  59. # This setting can be overridden by the -log or -nolog command-line arguments.
  60. log = ['interwiki']
  61. # filename defaults to modulename-bot.log
  62. logfilename = None
  63. # maximal size of a logfile in kilobytes. If the size reached that limit the
  64. # logfile will be renamed (if logfilecount is not 0) and the old file is filled
  65. # again. logfilesize must be an integer value
  66. logfilesize = 1024
  67. # Number of rotating logfiles are created. The older files get the higher
  68. # number. If logfilecount is 0, no logfile will be archived but the current
  69. # logfile will be overwritten if the file size reached the logfilesize above.
  70. # If logfilecount is -1 there are no rotating logfiles but the files where
  71. # renamed if the logfile is full. The newest file gets the highest number until
  72. # some logfiles where deleted.
  73. logfilecount = 5
  74. # set to 1 (or higher) to generate "informative" messages to terminal
  75. verbose_output = 0
  76. # set to True to fetch the pywiki version online
  77. log_pywiki_repo_version = False
  78. # if True, include a lot of debugging info in logfile
  79. # (overrides log setting above)
  80. debug_log = []
  81.  
  82. # ############# INTERWIKI SETTINGS ##############
  83.  
  84. # Should interwiki.py report warnings for missing links between foreign
  85. # languages?
  86. interwiki_backlink = True
  87.  
  88. # Should interwiki.py display every new link it discovers?
  89. interwiki_shownew = True
  90.  
  91. # Should interwiki.py output a graph PNG file on conflicts?
  92. # You need pydot for this:
  93. # https://pypi.python.org/pypi/pydot/1.0.2
  94. # https://code.google.com/p/pydot/
  95. interwiki_graph = False
  96.  
  97. # Specifies that the robot should process that amount of subjects at a time,
  98. # only starting to load new pages in the original language when the total
  99. # falls below that number. Default is to process (at least) 100 subjects at
  100. # once.
  101. interwiki_min_subjects = 100
  102.  
  103. # If interwiki graphs are enabled, which format(s) should be used?
  104. # Supported formats include png, jpg, ps, and svg. See:
  105. # http://www.graphviz.org/doc/info/output.html
  106. # If you want to also dump the dot files, you can use this in your
  107. # user-config.py:
  108. # interwiki_graph_formats = ['dot', 'png']
  109. # If you need a PNG image with an HTML image map, use this:
  110. # interwiki_graph_formats = ['png', 'cmap']
  111. # If you only need SVG images, use:
  112. # interwiki_graph_formats = ['svg']
  113. interwiki_graph_formats = ['png']
  114.  
  115. # You can post the contents of your autonomous_problems.dat to the wiki,
  116. # e.g. to https://de.wikipedia.org/wiki/Wikipedia:Interwiki-Konflikte .
  117. # This allows others to assist you in resolving interwiki problems.
  118. # To help these people, you can upload the interwiki graphs to your
  119. # webspace somewhere. Set the base URL here, e.g.:
  120. # 'https://www.example.org/~yourname/interwiki-graphs/'
  121. interwiki_graph_url = None
  122.  
  123. # Save file with local articles without interwikis.
  124. without_interwiki = False
  125.  
  126. # Experimental feature:
  127. # Store the page contents on disk (/cache/ directory) instead of loading
  128. # them in RAM.
  129. interwiki_contents_on_disk = False
  130.  
  131. # ############# SOLVE_DISAMBIGUATION SETTINGS ############
  132. #
  133. # Set disambiguation_comment[FAMILY][LANG] to a non-empty string to override
  134. # the default edit comment for the solve_disambiguation bot.
  135. # Use %s to represent the name of the disambiguation page being treated.
  136. # Example:
  137. #
  138. # disambiguation_comment['wikipedia']['en'] = \
  139. # "Robot-assisted disambiguation ([[WP:DPL|you can help!]]): %s"
  140.  
  141. # Sorting order for alternatives. Set to True to ignore case for sorting order.
  142. sort_ignore_case = False
  143.  
  144. # ############# IMAGE RELATED SETTINGS ##############
  145. # If you set this to True, images will be uploaded to Wikimedia
  146. # Commons by default.
  147. upload_to_commons = False
  148.  
  149. # ############# SETTINGS TO AVOID SERVER OVERLOAD ##############
  150.  
  151. # Slow down the robot such that it never requests a second page within
  152. # 'minthrottle' seconds. This can be lengthened if the server is slow,
  153. # but never more than 'maxthrottle' seconds. However - if you are running
  154. # more than one bot in parallel the times are lengthened.
  155. # By default, the get_throttle is turned off, and 'maxlag' is used to
  156. # control the rate of server access. Set minthrottle to non-zero to use a
  157. # throttle on read access.
  158. minthrottle = 0
  159. maxthrottle = 60
  160.  
  161. # Slow down the robot such that it never makes a second page edit within
  162. # 'put_throttle' seconds.
  163. put_throttle = 10
  164.  
  165. # Sometimes you want to know when a delay is inserted. If a delay is larger
  166. # than 'noisysleep' seconds, it is logged on the screen.
  167. noisysleep = 3.0
  168.  
  169. # Defer bot edits during periods of database server lag. For details, see
  170. # https://www.mediawiki.org/wiki/Maxlag_parameter
  171. # You can set this variable to a number of seconds, or to None (or 0) to
  172. # disable this behavior. Higher values are more aggressive in seeking
  173. # access to the wiki.
  174. # Non-Wikimedia wikis may or may not support this feature; for families
  175. # that do not use it, it is recommended to set minthrottle (above) to
  176. # at least 1 second.
  177. maxlag = 5
  178.  
  179. # Maximum of pages which can be retrieved by special pages. Increase this if
  180. # you heavily use redirect.py with action "double", and especially if you're
  181. # running solve_disambiguation.py with the -primary argument.
  182. special_page_limit = 500
  183.  
  184. # Maximum number of times to retry an API request before quitting.
  185. max_retries = 25
  186. # Minimum time to wait before resubmitting a failed API request.
  187. retry_wait = 5
  188.  
  189. # ############# TABLE CONVERSION BOT SETTINGS ##############
  190.  
  191. # will split long paragraphs for better reading the source.
  192. # only table2wiki.py use it by now
  193. splitLongParagraphs = False
  194. # sometimes HTML-tables are indented for better reading.
  195. # That can do very ugly results.
  196. deIndentTables = True
  197. # table2wiki.py works quite stable, so you might switch to True
  198. table2wikiAskOnlyWarnings = True
  199. table2wikiSkipWarnings = False
  200.  
  201. # ############# WEBLINK CHECKER SETTINGS ##############
  202.  
  203. # How many external links should weblinkchecker.py check at the same time?
  204. # If you have a fast connection, you might want to increase this number so
  205. # that slow servers won't slow you down.
  206. max_external_links = 50
  207.  
  208. report_dead_links_on_talk = False
  209.  
  210. # Don't alert on links days_dead old or younger
  211. weblink_dead_days = 7
  212.  
  213. # ############# DATABASE SETTINGS ##############
  214. # Setting to connect the database or replica of the database of the wiki.
  215. # db_name_format can be used to manipulate the dbName of site.
  216. # Example for a pywikibot running on wmflabs:
  217. # db_hostname = 'enwiki.labsdb'
  218. # db_name_format = '{0}_p'
  219. # db_connect_file = user_home_path('replica.my.cnf')
  220. db_hostname = 'localhost'
  221. db_username = ''
  222. db_password = ''
  223. db_name_format = '{0}'
  224. db_connect_file = user_home_path('.my.cnf')
  225. # local port for mysql server
  226. # ssh -L 4711:enwiki.labsdb:3306 user@tools-login.wmflabs.org
  227. db_port = 3306
  228.  
  229. # ############# SEARCH ENGINE SETTINGS ##############
  230.  
  231. # Yahoo! Search Web Services are not operational.
  232. # See https://phabricator.wikimedia.org/T106085
  233. yahoo_appid = ''
  234.  
  235. # To use Windows Live Search web service you must get an AppID from
  236. # http://www.bing.com/dev/en-us/dev-center
  237. msn_appid = ''
  238.  
  239. # ############# FLICKR RIPPER SETTINGS ##############
  240.  
  241. # Using the Flickr api
  242. flickr = {
  243. 'api_key': u'', # Provide your key!
  244. 'api_secret': u'', # Api secret of your key (optional)
  245. 'review': False, # Do we use automatically make our uploads reviewed?
  246. 'reviewer': u'', # If so, under what reviewer name?
  247. }
  248.  
  249. # Using the Panoramio api
  250. panoramio = {
  251. 'review': False, # Do we use automatically make our uploads reviewed?
  252. 'reviewer': u'', # If so, under what reviewer name?
  253. }
  254.  
  255.  
  256. # ############# COPYRIGHT SETTINGS ##############
  257.  
  258. # Enable/disable search engine in copyright.py script
  259. copyright_google = True
  260. copyright_yahoo = True
  261. copyright_msn = False
  262.  
  263. # Perform a deep check, loading URLs to search if 'Wikipedia' is present.
  264. # This may be useful to increase the number of correct results. If you haven't
  265. # a fast connection, you might want to keep them disabled.
  266. copyright_check_in_source_google = False
  267. copyright_check_in_source_yahoo = False
  268. copyright_check_in_source_msn = False
  269.  
  270. # Web pages may contain a Wikipedia text without the word 'Wikipedia' but with
  271. # the typical '[edit]' tag as a result of a copy & paste procedure. You want
  272. # no report for this kind of URLs, even if they are copyright violations.
  273. # However, when enabled, these URLs are logged in a file.
  274. copyright_check_in_source_section_names = False
  275.  
  276. # Limit number of queries for page.
  277. copyright_max_query_for_page = 25
  278.  
  279. # Skip a specified number of queries
  280. copyright_skip_query = 0
  281.  
  282. # Number of attempts on connection error.
  283. copyright_connection_tries = 10
  284.  
  285. # Behavior if an exceeded error occur.
  286. #
  287. # Possibilities:
  288. #
  289. # 0 = None
  290. # 1 = Disable search engine
  291. # 2 = Sleep (default)
  292. # 3 = Stop
  293. copyright_exceeded_in_queries = 2
  294. copyright_exceeded_in_queries_sleep_hours = 6
  295.  
  296. # Append last modified date of URL to script result
  297. copyright_show_date = True
  298.  
  299. # Append length of URL to script result
  300. copyright_show_length = True
  301.  
  302. # By default the script tries to identify and skip text that contains a large
  303. # comma separated list or only numbers. But sometimes that might be the
  304. # only part unmodified of a slightly edited and not otherwise reported
  305. # copyright violation. You can disable this feature to try to increase the
  306. # number of results.
  307. copyright_economize_query = True
  308.  
  309. # ############# HTTP SETTINGS ##############
  310. # Use a persistent http connection. An http connection has to be established
  311. # only once per site object, making stuff a whole lot faster. Do NOT EVER
  312. # use this if you share Site objects across threads without proper locking.
  313. #
  314. # DISABLED FUNCTION. Setting this variable will not have any effect.
  315. persistent_http = False
  316.  
  317. # Default socket timeout in seconds.
  318. # DO NOT set to None to disable timeouts. Otherwise this may freeze your script.
  319. # You may assign either a tuple of two int or float values for connection and
  320. # read timeout, or a single value for both in a tuple (since requests 2.4.0).
  321. socket_timeout = 30
  322.  
  323.  
  324. # ############# COSMETIC CHANGES SETTINGS ##############
  325. # The bot can make some additional changes to each page it edits, e.g. fix
  326. # whitespace or positioning of interwiki and category links.
  327.  
  328. # This is an experimental feature; handle with care and consider re-checking
  329. # each bot edit if enabling this!
  330. cosmetic_changes = True
  331.  
  332. # If cosmetic changes are switched on, and you also have several accounts at
  333. # projects where you're not familiar with the local conventions, you probably
  334. # only want the bot to do cosmetic changes on your "home" wiki which you
  335. # specified in config.mylang and config.family.
  336. # If you want the bot to also do cosmetic changes when editing a page on a
  337. # foreign wiki, set cosmetic_changes_mylang_only to False, but be careful!
  338. cosmetic_changes_mylang_only = True
  339.  
  340. # The dictionary cosmetic_changes_enable should contain a tuple of languages
  341. # for each site where you wish to enable in addition to your own langlanguage
  342. # (if cosmetic_changes_mylang_only is set)
  343. # Please set your dictionary by adding such lines to your user-config.py:
  344. # cosmetic_changes_enable['wikipedia'] = ('de', 'en', 'fr')
  345. cosmetic_changes_enable = {}
  346.  
  347. # The dictionary cosmetic_changes_disable should contain a tuple of languages
  348. # for each site where you wish to disable cosmetic changes. You may use it with
  349. # cosmetic_changes_mylang_only is False, but you can also disable your own
  350. # language. This also overrides the settings in the cosmetic_changes_enable
  351. # dictionary. Please set your dict by adding such lines to your user-config.py:
  352. # cosmetic_changes_disable['wikipedia'] = ('de', 'en', 'fr')
  353. cosmetic_changes_disable = {}
  354.  
  355. # cosmetic_changes_deny_script is a list of scripts for which cosmetic changes
  356. # are disabled. You may add additional scripts by appending script names in
  357. # your user_config.py ("+=" operator is strictly recommended):
  358. # cosmetic_changes_deny_script += ['your_script_name_1', 'your_script_name_2']
  359. # Appending the script name also works:
  360. # cosmetic_changes_deny_script.append('your_script_name')
  361. cosmetic_changes_deny_script = ['category_redirect', 'cosmetic_changes',
  362. 'newitem', 'touch']
  363.  
  364. # ############# REPLICATION BOT ################
  365. # You can add replicate_replace to your user_config.py, which has the following
  366. # format:
  367. #
  368. # replicate_replace = {
  369. # 'wikipedia:li': {'Hoofdpagina': 'Veurblaad'}
  370. # }
  371. #
  372. # to replace all occurrences of 'Hoofdpagina' with 'Veurblaad' when writing to
  373. # liwiki. Note that this does not take the origin wiki into account.
  374. replicate_replace = {}
  375.  
  376. # ############# FURTHER SETTINGS ##############
  377.  
  378. # Proxy configuration
  379.  
  380. # TODO: proxy support
  381. proxy = None
  382.  
  383. # Simulate settings
  384.  
  385. # Defines what additional actions the bots are NOT allowed to do (e.g. 'edit')
  386. # on the wiki server. Allows simulation runs of bots to be carried out without
  387. # changing any page on the server side. Use this setting to add more actions
  388. # in user-config.py for wikis with extra write actions.
  389. actions_to_block = []
  390.  
  391. # Set simulate to True or use -simulate option to block all actions given above.
  392. simulate = False
  393.  
  394. # How many pages should be put to a queue in asynchronous mode.
  395. # If maxsize is <= 0, the queue size is infinite.
  396. # Increasing this value will increase memory space but could speed up
  397. # processing. As higher this value this effect will decrease.
  398. max_queue_size = 64
  399.  
  400. # Define the line separator. Pages retrieved via API have "\n" whereas
  401. # pages fetched from screen (mostly) have "\r\n". Interwiki and category
  402. # separator settings in family files should use multiplied of this.
  403. # LS is a shortcut alias.
  404. line_separator = LS = u'\n'
  405.  
  406. # Settings to enable mwparserfromhell
  407. # <https://mwparserfromhell.readthedocs.org/en/latest/>
  408. # Currently used in textlib.extract_templates_and_params
  409. # This is more accurate than our current regex, but only works
  410. # if the user has already installed the library.
  411. use_mwparserfromhell = True
  412.  
  413. # Pickle protocol version to use for storing dumps.
  414. # This config variable is not used for loading dumps.
  415. # Version 2 is common to both Python 2 and 3, and should
  416. # be used when dumps are accessed by both versions.
  417. # Version 4 is only available for Python 3.4
  418. pickle_protocol = 2
  419.  
  420. # End of configuration section
Add Comment
Please, Sign In to add comment