Skip to content

Commit

Permalink
migrated to new py-3rdparty-mediawiki version
Browse files Browse the repository at this point in the history
  • Loading branch information
tholzheim committed Dec 6, 2022
1 parent bd7eaf5 commit 2fe635b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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 "
}]
}
```
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tests/default_wikiuser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@author: wf
'''
from wikibot.wikiuser import WikiUser
from wikibot3rd.wikiuser import WikiUser
import os
import getpass

Expand Down
14 changes: 8 additions & 6 deletions tests/test_wikiFileManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,29 @@
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
import os
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("~")
Expand Down Expand Up @@ -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):
Expand Down
7 changes: 3 additions & 4 deletions wikifile/metamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion wikifile/wikiFileManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2fe635b

Please sign in to comment.