diff --git a/README.md b/README.md index 15a94a5..31285e8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Provides jinja templates to create wiki page files form JSON input ## Install -```json +```bash pip install wikirender ``` check if it worked with @@ -68,6 +68,7 @@ Returns: "Submission deadline": "2008/10/02", "Filename": "CC 2009" } + ] } ``` > Note: As the name says the data is only extracted form the file. Meaning that also template arguments with invalid arguments are included in the result which is contrary to querying the templates in the wiki (invalid values are excluded there) @@ -91,7 +92,7 @@ To generate the pages the following input is required: "icon": "File:EventLogo-64px.png", "iconUrl": "", "documentation": "a meeting of researchers at a specific time and place", - "wikiDocumentation": "a meeting of researchers at a specific time and place (virtual or physical) and with a specific thematic focus to present, hear and discuss research outputs ", + "wikiDocumentation": "a meeting of researchers at a specific time and place (virtual or physical) and with a specific thematic focus to present, hear and discuss research outputs " }] } ``` diff --git a/requirements.txt b/requirements.txt index b2f4c33..858ea97 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,6 @@ wikitextparser # https://pypi.org/project/Jinja2/ jinja2 # https://pypi.org/project/pylodstorage/ -pylodstorage>=0.2.0 +pylodstorage>=0.4.7 # https://pypi.org/project/py-3rdparty-mediawiki/ -py-3rdparty-mediawiki>=0.5.4 +py-3rdparty-mediawiki>=0.8.0 diff --git a/tests/default_wikiuser.py b/tests/default_wikiuser.py index f91214d..d43eb75 100644 --- a/tests/default_wikiuser.py +++ b/tests/default_wikiuser.py @@ -3,7 +3,7 @@ @author: wf ''' -from wikibot.wikiuser import WikiUser +from wikibot3rd.wikiuser import WikiUser import os import getpass diff --git a/tests/test_wikiFileManager.py b/tests/test_wikiFileManager.py index a743672..6164723 100644 --- a/tests/test_wikiFileManager.py +++ b/tests/test_wikiFileManager.py @@ -4,11 +4,11 @@ import getpass from pathlib import Path -from wikibot.wikiuser import WikiUser +from wikibot3rd.wikiuser import WikiUser from wikifile.wikiFile import WikiFile from wikifile.wikiFileManager import WikiFileManager -from wikibot.wikipush import WikiPush +from wikibot3rd.wikipush import WikiPush from datetime import datetime from random import random import io @@ -16,15 +16,17 @@ import time from tests.default_wikiuser import DefaultWikiUser + class TestWikiFileManager(unittest.TestCase): - ''' + """ test WikiFileManager - ''' + """ + + wikiFileManagers = dict() @classmethod def setUpClass(cls): super(TestWikiFileManager, cls).setUpClass() - cls.wikiFileManagers={} for wikiId in ["or","orclone","wikirenderTest"]: _wikiUser=DefaultWikiUser.getSMW_WikiUser(wikiId) home = os.path.expanduser("~") @@ -58,7 +60,7 @@ def inPublicCI(self): ''' are we running in a public Continuous Integration Environment? ''' - return getpass.getuser() in ["travis", "runner"]; + return getpass.getuser() in ["travis", "runner"] def testGetWikiAllWikiFilesForArgs(self): diff --git a/wikifile/metamodel.py b/wikifile/metamodel.py index 51434df..79895ed 100644 --- a/wikifile/metamodel.py +++ b/wikifile/metamodel.py @@ -26,15 +26,14 @@ def get_samples(cls): return samples def __init__(self, propList: list = None, properties: dict = None, template=None): - ''' + """ construct me from the given properties and the given propertyMap - + Args: propList(list): a list of field names properties(dict): a dictionary of properties template(str): the template to be used - lenient(bool): if False throw an exception if invalid property names are in the properties dict - ''' + """ super().__init__() self.template=template if propList is None: diff --git a/wikifile/wikiFileManager.py b/wikifile/wikiFileManager.py index cbf2c18..07ac136 100644 --- a/wikifile/wikiFileManager.py +++ b/wikifile/wikiFileManager.py @@ -5,7 +5,7 @@ from lodstorage.lod import LOD from typing import List -from wikibot.wikipush import WikiPush +from wikibot3rd.wikipush import WikiPush from wikifile.wikiFile import WikiFile from wikifile.cmdline import CmdLineAble from wikifile.wikiRender import WikiRender