7 Commits

Author SHA1 Message Date
f9e4207651 Merge branch 'release-1.2' 2017-11-05 15:52:46 +01:00
5267966fa8 Update version info and copyright notices 2017-11-05 15:52:08 +01:00
0b17998484 Update jogobot-module to v0.1 2017-11-05 15:45:17 +01:00
82662fc882 Merge branch 'release-1.1' 2017-11-05 15:41:45 +01:00
cb11097664 Merge branch 'fs#118-remove-linebreaks' into develop 2017-11-05 15:37:43 +01:00
db6e7fd246 Merge branch 'release-1.0' 2017-11-05 15:36:16 +01:00
af44323930 Cut Titel and Interpret on first linebreak
For some asian countries there is the original name following after a
linebreak. This is not needed in overview, so cat it of.

Related Task: [https://fs.golderweb.de/index.php?do=details&task_id=118 FS#118]
2017-04-10 20:40:39 +02:00
6 changed files with 40 additions and 8 deletions

5
.gitmodules vendored
View File

@@ -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

View File

@@ -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>

View File

@@ -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

View File

@@ -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

Submodule jogobot updated: 9131235b7b...d69d873624

View File

@@ -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