14 Commits

Author SHA1 Message Date
33b2e47312 Describe version test-v7 2017-10-28 22:43:53 +02:00
3bd17ce692 Merge branch 'fs#160-urlencoded-chars' into develop 2017-10-28 22:36:55 +02:00
5f4640d5ff Replace urlencoded chars with unicode equivalent
Otherwise we get value errors while marking since pwb replaces those

Related Task: [FS#160](https://fs.golderweb.de/index.php?do=details&task_id=160)
2017-10-28 22:35:25 +02:00
7e0456ae4f Merge branch 'test-v6' back into develop 2017-10-28 22:34:30 +02:00
108b7aa331 Describe version test-v6 2017-10-28 18:46:30 +02:00
a3adf31b89 Merge branch 'fs#86-activate-status-api' into develop 2017-10-28 18:44:42 +02:00
614f288bb9 Activate jogobot status api for onwiki disabling
Related Task: [FS#86](https://fs.golderweb.de/index.php?do=details&task_id=86)
2017-10-28 18:44:05 +02:00
c450a045bf Merge branch 'fs#159-space-before-anchor' into develop 2017-10-28 18:43:13 +02:00
84802cf521 Remove leading or trailing spaces in articles
Some articles contain spaces between title and anchor part which will
be stripped now

Related Task: [FS#159](https://fs.golderweb.de/index.php?do=details&task_id=159)
2017-10-28 18:41:06 +02:00
5f6c443ba8 Merge branch 'test-v5' back into develop 2017-10-28 18:17:01 +02:00
0c135ef1bb Describe version test-v5 2017-09-23 23:50:42 +02:00
8b8221cfcd Merge branch 'fs#152-respect-always-flag' into develop 2017-09-23 23:49:59 +02:00
bdccc8417c Set always in Pywikibot.Basebot
If cmdline param -always is set, set the related option in
Pywikibot.Basebot Object for automatic edits with out further requests

Related Task: [FS#152](https://fs.golderweb.de/index.php?do=details&task_id=152)
2017-09-23 23:49:41 +02:00
a70835c58a Merge back branch 'test-v4' into develop 2017-09-23 23:48:25 +02:00
4 changed files with 24 additions and 3 deletions

View File

@@ -18,6 +18,17 @@ Those can be installed using pip and the _requirements.txt_ file provided with t
Versions
--------
* test-v7
- Fixed problem with url encoded chars in article title
* test-v6
- jogobot status API enabled (Bot can be disabled onwiki)
- Fixed problem with space between article title and anchor
* test-v5
- Feature _markpages_ working in full-automatic mode with _always_-flag
python red.py -task:markpages -family:wikipedia -always
* test-v4

View File

@@ -73,7 +73,9 @@ class MarkPagesBot( CurrentPageBot ): # sets 'current_page' on each treat()
self.build_generator()
# Run super class init with builded generator
super( MarkPagesBot, self ).__init__(generator=self.gen)
super( MarkPagesBot, self ).__init__(
generator=self.gen,
always=True if "always" in kwargs else False )
def run(self):
"""

View File

@@ -28,6 +28,7 @@ Provides classes for working with RedFams
import hashlib
import locale
import re
import urllib.parse
from datetime import datetime
import mwparserfromhell as mwparser # noqa
@@ -291,12 +292,19 @@ class RedFamParser( RedFam ):
# Make sure first letter is uppercase
article = article[0].upper() + article[1:]
# Unquote possible url encoded special chars
article = urllib.parse.unquote( article )
# Split in title and anchor part
article = article.split("#", 1)
# Replace underscores in title with spaces
article[0] = article[0].replace("_", " ")
if len(article) > 1:
# Strip both parts to prevent leading/trailing spaces
article[0] = article[0].strip()
article[1] = article[1].strip()
# other way round, replace spaces with underscores in anchors
article[1] = article[1].replace(" ", "_")

4
red.py
View File

@@ -124,8 +124,8 @@ def main(*args):
# Disabled until [FS#86] is done
# Before run, we need to check wether we are currently active or not
# if not jogobot.bot.active( task_slug ):
# return
if not jogobot.bot.active( task_slug ):
return
# Parse local Args to get information about subtask
( subtask, genFactory, subtask_args ) = jogobot.bot.parse_local_args(