Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f9e4207651 | |||
| 5267966fa8 | |||
| 0b17998484 | |||
| 82662fc882 | |||
| cb11097664 | |||
| af44323930 |
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,4 +1,3 @@
|
|||||||
[submodule "jogobot"]
|
[submodule "jogobot"]
|
||||||
path = jogobot
|
path = jogobot
|
||||||
url = git@github.com:golderweb/wiki-jogobot-core.git
|
url = ../jogobot
|
||||||
branch = test-v1
|
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -11,6 +11,14 @@ On [JogoBots wikipedia user page](https://de.wikipedia.org/wiki/Benutzer:JogoBot
|
|||||||
* [jogobot-core module](https://github.com/golderweb/wiki-jogobot-core) used as submodule
|
* [jogobot-core module](https://github.com/golderweb/wiki-jogobot-core) used as submodule
|
||||||
* [Isoweek module](https://pypi.python.org/pypi/isoweek)
|
* [Isoweek module](https://pypi.python.org/pypi/isoweek)
|
||||||
|
|
||||||
|
## Versions
|
||||||
|
* 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)
|
[wiki-jogobot-charts on fs.golderweb.de (de)](https://fs.golderweb.de/proj20)
|
||||||
|
|
||||||
@@ -18,4 +26,4 @@ On [JogoBots wikipedia user page](https://de.wikipedia.org/wiki/Benutzer:JogoBot
|
|||||||
GPLv3+
|
GPLv3+
|
||||||
|
|
||||||
## Author Information
|
## Author Information
|
||||||
Copyright 2016 Jonathan Golder <jonathan@golderweb.de>
|
Copyright 2017 Jonathan Golder <jonathan@golderweb.de>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#
|
#
|
||||||
# modified by:
|
# modified by:
|
||||||
#
|
#
|
||||||
# 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
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -284,6 +284,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 +359,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 +464,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
|
||||||
|
|||||||
2
jogobot
2
jogobot
Submodule jogobot updated: 9131235b7b...d69d873624
@@ -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