Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
dfca5f1f33
|
|||
| 0d62c249cd | |||
| 6a6c6ea634 | |||
| 7bc4f546f8 | |||
| 3fb86abac5 | |||
| 871cbccc72 | |||
| e61408f877 | |||
| e6ef20f0a4 | |||
| f9e4207651 | |||
| 5267966fa8 | |||
| 0b17998484 | |||
| 82662fc882 | |||
| cb11097664 | |||
| af44323930 |
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -1,4 +0,0 @@
|
|||||||
[submodule "jogobot"]
|
|
||||||
path = jogobot
|
|
||||||
url = git@github.com:golderweb/wiki-jogobot-core.git
|
|
||||||
branch = test-v1
|
|
||||||
37
README.md
37
README.md
@@ -6,16 +6,41 @@ 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
|
||||||
* Python 3.4+ (at least it is only tested with those)
|
* python3.4+
|
||||||
* pywikibot-core 2.0
|
|
||||||
* [jogobot-core module](https://github.com/golderweb/wiki-jogobot-core) used as submodule
|
|
||||||
* [Isoweek module](https://pypi.python.org/pypi/isoweek)
|
* pywikibot-core
|
||||||
|
|
||||||
|
|
||||||
|
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.1
|
||||||
|
- support dates without day (YYYY-mm)
|
||||||
|
|
||||||
|
* 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
|
||||||
[wiki-jogobot-charts on fs.golderweb.de (de)](https://fs.golderweb.de/proj20)
|
[jogobot-charts Issues](https://git.golderweb.de/wiki/jogobot-charts/issues)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
GPLv3+
|
GPLv3+
|
||||||
|
|
||||||
## Author Information
|
## Author Information
|
||||||
Copyright 2016 Jonathan Golder <jonathan@golderweb.de>
|
Copyright 2021 Jonathan Golder <jonathan@golderweb.de>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#
|
#
|
||||||
# modified by:
|
# modified by:
|
||||||
#
|
#
|
||||||
# Copyright 2016 Jonathan Golder <jonathan@golderweb.de>
|
# Copyright 2021 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
|
||||||
@@ -256,7 +256,7 @@ def main(*args):
|
|||||||
force_reload = True
|
force_reload = True
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
genFactory.handleArg(arg)
|
genFactory.handle_arg(arg)
|
||||||
|
|
||||||
if not gen:
|
if not gen:
|
||||||
gen = genFactory.getCombinedGenerator()
|
gen = genFactory.getCombinedGenerator()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# countrylist.py
|
# countrylist.py
|
||||||
#
|
#
|
||||||
# Copyright 2016 Jonathan Golder <jonathan@golderweb.de>
|
# Copyright 2017 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
|
||||||
@@ -239,8 +239,11 @@ class CountryList():
|
|||||||
int( self._chartein_raw ) ).monday() )
|
int( self._chartein_raw ) ).monday() )
|
||||||
# Complete date string present
|
# Complete date string present
|
||||||
else:
|
else:
|
||||||
self.chartein = datetime.strptime( self._chartein_raw,
|
try:
|
||||||
|
self.chartein = datetime.strptime( self._chartein_raw,
|
||||||
"%Y-%m-%d" )
|
"%Y-%m-%d" )
|
||||||
|
except ValueError:
|
||||||
|
self.chartein = datetime.strptime( self._chartein_raw, "%Y-%m" )
|
||||||
|
|
||||||
def get_chartein_value( self ):
|
def get_chartein_value( self ):
|
||||||
"""
|
"""
|
||||||
@@ -284,6 +287,9 @@ 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 )
|
||||||
@@ -356,6 +362,9 @@ 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 )
|
||||||
@@ -458,6 +467,25 @@ 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
1
jogobot
Submodule jogobot deleted from 9131235b7b
8
requirements.txt
Normal file
8
requirements.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# mwparserfromhell
|
||||||
|
mwparserfromhell
|
||||||
|
|
||||||
|
# isoweek
|
||||||
|
isoweek
|
||||||
|
|
||||||
|
# jogobot
|
||||||
|
git+https://git.golderweb.de/wiki/jogobot.git#egg=jogobot
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# summarypage.py
|
# summarypage.py
|
||||||
#
|
#
|
||||||
# Copyright 2016 Jonathan Golder <jonathan@golderweb.de>
|
# Copyright 2017 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