Commit ae006f3e authored by Charles de Beauchesne's avatar Charles de Beauchesne

+ doc

parent 9bb02750
Pipeline #42121296 passed with stages
in 2 minutes and 14 seconds
......@@ -11,5 +11,7 @@ As a good short example will always be better than a long explanation, here is s
get_documents
search_text
rock_type
get_forum_users_from_route
update_locale
Update a locale field
=====================================
This script will update remarks field.
Note the coding header, if you're in Python 2.7, and your update contains special characters
.. code-block:: python
# coding: utf-8
import sys
from campbot import CampBot
bot = CampBot()
bot.login("botname", "botpass")
remarks="!! VTNO rocks!"
filters = {
"w": 107049,
"act":["rock_climbing"]
}
for route in bot.wiki.get_routes(filters):
remarks=route.get_locale("fr").remarks
if remarks is None:
route.get_locale("fr").remarks = remarks
route.save("Remarque gestion par VTNO")
elif remarks is not None and "VTNO" not in remarks:
# We consider that if VTNO still exists, then locale is still processed
route.get_locale("fr").remarks = remarks + "\n\n" + remark
route.save("Remarque gestion par VTNO")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment