Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db6e7fd246 |
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[submodule "jogobot"]
|
||||||
|
path = jogobot
|
||||||
|
url = git@github.com:golderweb/wiki-jogobot-core.git
|
||||||
|
branch = test-v1
|
||||||
34
README.md
34
README.md
@@ -6,38 +6,16 @@ of [User:JogoBot](https://de.wikipedia.org/wiki/Benutzer:JogoBot) on the
|
|||||||
On [JogoBots wikipedia user page](https://de.wikipedia.org/wiki/Benutzer:JogoBot/Charts) a more detailed description can be found.
|
On [JogoBots wikipedia user page](https://de.wikipedia.org/wiki/Benutzer:JogoBot/Charts) a more detailed description can be found.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
* python3.4+
|
* Python 3.4+ (at least it is only tested with those)
|
||||||
|
* pywikibot-core 2.0
|
||||||
|
* [jogobot-core module](https://github.com/golderweb/wiki-jogobot-core) used as submodule
|
||||||
* pywikibot-core
|
* [Isoweek module](https://pypi.python.org/pypi/isoweek)
|
||||||
|
|
||||||
|
|
||||||
The libraries above need to be installed and configured manualy considering [documentation of pywikibot-core](https://www.mediawiki.org/wiki/Manual:Pywikibot).
|
|
||||||
|
|
||||||
* mwparserfromhell
|
|
||||||
* isoweek
|
|
||||||
* [jogobot-core module](https://git.golderweb.de/wiki/jogobot)
|
|
||||||
|
|
||||||
Those can be installed using pip and the _requirements.txt_ file provided with this packet
|
|
||||||
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
## Versions
|
|
||||||
|
|
||||||
* v1.3
|
|
||||||
- jogobot module not longer included
|
|
||||||
* v1.2
|
|
||||||
- improved repo structure
|
|
||||||
* v1.1
|
|
||||||
- Cut Titel and Interpret on first linebreak
|
|
||||||
* v1.0
|
|
||||||
- first stable release
|
|
||||||
|
|
||||||
## Bugs
|
## Bugs
|
||||||
[jogobot-charts Issues](https://git.golderweb.de/wiki/jogobot-charts/issues)
|
[wiki-jogobot-charts on fs.golderweb.de (de)](https://fs.golderweb.de/proj20)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
GPLv3+
|
GPLv3+
|
||||||
|
|
||||||
## Author Information
|
## Author Information
|
||||||
Copyright 2018 Jonathan Golder <jonathan@golderweb.de>
|
Copyright 2016 Jonathan Golder <jonathan@golderweb.de>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#
|
#
|
||||||
# modified by:
|
# modified by:
|
||||||
#
|
#
|
||||||
# Copyright 2017 Jonathan Golder <jonathan@golderweb.de>
|
# Copyright 2016 Jonathan Golder <jonathan@golderweb.de>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# countrylist.py
|
# countrylist.py
|
||||||
#
|
#
|
||||||
# Copyright 2017 Jonathan Golder <jonathan@golderweb.de>
|
# Copyright 2016 Jonathan Golder <jonathan@golderweb.de>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -284,9 +284,6 @@ missing!" )
|
|||||||
if self.entry.has( "Titel" ):
|
if self.entry.has( "Titel" ):
|
||||||
self._titel_raw = self.entry.get("Titel").value
|
self._titel_raw = self.entry.get("Titel").value
|
||||||
|
|
||||||
# Only use part before possible "<br"
|
|
||||||
self.remove_lines(self._titel_raw)
|
|
||||||
|
|
||||||
# Remove possible ref-tags
|
# Remove possible ref-tags
|
||||||
for ref in self._titel_raw.ifilter_tags(matches="ref"):
|
for ref in self._titel_raw.ifilter_tags(matches="ref"):
|
||||||
self._titel_raw.remove( ref )
|
self._titel_raw.remove( ref )
|
||||||
@@ -359,9 +356,6 @@ missing!" )
|
|||||||
if self.entry.has( "Interpret" ):
|
if self.entry.has( "Interpret" ):
|
||||||
self._interpret_raw = self.entry.get("Interpret").value
|
self._interpret_raw = self.entry.get("Interpret").value
|
||||||
|
|
||||||
# Only use part before possible "<br"
|
|
||||||
self.remove_lines(self._interpret_raw)
|
|
||||||
|
|
||||||
# Remove possible ref-tags
|
# Remove possible ref-tags
|
||||||
for ref in self._interpret_raw.ifilter_tags(matches="ref"):
|
for ref in self._interpret_raw.ifilter_tags(matches="ref"):
|
||||||
self._interpret_raw.remove( ref )
|
self._interpret_raw.remove( ref )
|
||||||
@@ -464,25 +458,6 @@ missing!" )
|
|||||||
else:
|
else:
|
||||||
return str(keywords[0])
|
return str(keywords[0])
|
||||||
|
|
||||||
def remove_lines(self, wikicode):
|
|
||||||
"""
|
|
||||||
Removes linebreaks (<br>) and everything after them in given wikicode
|
|
||||||
"""
|
|
||||||
# Catch wrong typed param
|
|
||||||
if not isinstance(wikicode, mwparser.wikicode.Wikicode):
|
|
||||||
raise TypeError(str(type(self)) + "._remove_lines() expects " +
|
|
||||||
"parameter 'wikicode' of type " +
|
|
||||||
"'mwparserfromhell.wikicode.Wikicode', " +
|
|
||||||
str(type(wikicode)) + " was given!")
|
|
||||||
|
|
||||||
# Find first linebreak
|
|
||||||
br = next(wikicode.ifilter_tags(matches="br"), None)
|
|
||||||
|
|
||||||
# If there is one, get its position and slice nodes-list
|
|
||||||
if br:
|
|
||||||
brpos = wikicode.nodes.index(br)
|
|
||||||
wikicode.nodes = wikicode.nodes[0:brpos]
|
|
||||||
|
|
||||||
def __str__( self ):
|
def __str__( self ):
|
||||||
"""
|
"""
|
||||||
Returns str repression for Object
|
Returns str repression for Object
|
||||||
|
|||||||
1
jogobot
Submodule
1
jogobot
Submodule
Submodule jogobot added at 9131235b7b
@@ -1,8 +0,0 @@
|
|||||||
# mwparserfromhell
|
|
||||||
mwparserfromhell
|
|
||||||
|
|
||||||
# isoweek
|
|
||||||
isoweek
|
|
||||||
|
|
||||||
# jogobot
|
|
||||||
git+https://git.golderweb.de/wiki/jogobot.git#egg=jogobot
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# summarypage.py
|
# summarypage.py
|
||||||
#
|
#
|
||||||
# Copyright 2017 Jonathan Golder <jonathan@golderweb.de>
|
# Copyright 2016 Jonathan Golder <jonathan@golderweb.de>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
Reference in New Issue
Block a user