Fix a bug where I forgot to use keyword args.

This commit is contained in:
Elliott Pardee 2018-08-24 04:40:55 -04:00
parent 80717b6163
commit a809176318
4 changed files with 58 additions and 47 deletions

96
.idea/workspace.xml generated
View File

@ -2,7 +2,9 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="c8edefbc-71df-41a9-9878-b830c52cd7b5" name="Default Changelist" comment=""> <list default="true" id="c8edefbc-71df-41a9-9878-b830c52cd7b5" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/goarch_api/client.py" beforeDir="false" afterPath="$PROJECT_DIR$/goarch_api/client.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/goarch_api/client.py" beforeDir="false" afterPath="$PROJECT_DIR$/goarch_api/client.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/goarch_api/saint.py" beforeDir="false" afterPath="$PROJECT_DIR$/goarch_api/saint.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/setup.py" beforeDir="false" afterPath="$PROJECT_DIR$/setup.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/setup.py" beforeDir="false" afterPath="$PROJECT_DIR$/setup.py" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@ -15,10 +17,10 @@
<session id="1829562699"> <session id="1829562699">
<usages-collector id="statistics.lifecycle.project"> <usages-collector id="statistics.lifecycle.project">
<counts> <counts>
<entry key="project.closed" value="1" /> <entry key="project.closed" value="3" />
<entry key="project.open.time.2" value="1" /> <entry key="project.open.time.2" value="2" />
<entry key="project.open.time.4" value="1" /> <entry key="project.open.time.4" value="2" />
<entry key="project.opened" value="2" /> <entry key="project.opened" value="4" />
</counts> </counts>
</usages-collector> </usages-collector>
<usages-collector id="statistics.file.extensions.open"> <usages-collector id="statistics.file.extensions.open">
@ -43,7 +45,7 @@
<entry key="dummy" value="14" /> <entry key="dummy" value="14" />
<entry key="gitignore" value="1" /> <entry key="gitignore" value="1" />
<entry key="md" value="690" /> <entry key="md" value="690" />
<entry key="py" value="11446" /> <entry key="py" value="11483" />
<entry key="txt" value="122" /> <entry key="txt" value="122" />
</counts> </counts>
</usages-collector> </usages-collector>
@ -51,7 +53,7 @@
<counts> <counts>
<entry key="Markdown" value="690" /> <entry key="Markdown" value="690" />
<entry key="PLAIN_TEXT" value="137" /> <entry key="PLAIN_TEXT" value="137" />
<entry key="Python" value="11508" /> <entry key="Python" value="11545" />
</counts> </counts>
</usages-collector> </usages-collector>
</session> </session>
@ -108,12 +110,12 @@
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/goarch_api/client.py"> <entry file="file://$PROJECT_DIR$/goarch_api/client.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="161"> <state relative-caret-position="36">
<caret line="7" lean-forward="true" selection-start-line="7" selection-end-line="7" /> <caret line="8" column="79" selection-start-line="8" selection-start-column="79" selection-end-line="8" selection-end-column="79" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
<marker date="1535039169428" expanded="true" signature="46:47" ph="..." /> <marker date="1535100009297" expanded="true" signature="46:47" ph="..." />
<marker date="1535039169428" expanded="true" signature="46:51" ph="..." /> <marker date="1535100009297" expanded="true" signature="46:51" ph="..." />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -122,7 +124,7 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/goarch_api/daily.py"> <entry file="file://$PROJECT_DIR$/goarch_api/daily.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="174"> <state relative-caret-position="289">
<caret line="62" column="51" selection-start-line="62" selection-start-column="51" selection-end-line="62" selection-end-column="51" /> <caret line="62" column="51" selection-start-line="62" selection-start-column="51" selection-end-line="62" selection-end-column="51" />
<folding> <folding>
<element signature="e#0#22#0" expanded="true" /> <element signature="e#0#22#0" expanded="true" />
@ -135,14 +137,18 @@
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/goarch_api/models.py"> <entry file="file://$PROJECT_DIR$/goarch_api/models.py">
<provider selected="true" editor-type-id="text-editor" /> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="23">
<caret line="41" column="23" lean-forward="true" selection-start-line="41" selection-start-column="23" selection-end-line="41" selection-end-column="23" />
</state>
</provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/goarch_api/saint.py"> <entry file="file://$PROJECT_DIR$/goarch_api/saint.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220"> <state relative-caret-position="138">
<caret line="17" column="66" selection-start-line="17" selection-start-column="66" selection-end-line="17" selection-end-column="66" /> <caret line="36" column="36" lean-forward="true" selection-start-line="36" selection-start-column="36" selection-end-line="36" selection-end-column="36" />
<folding> <folding>
<element signature="e#0#9#0" expanded="true" /> <element signature="e#0#9#0" expanded="true" />
</folding> </folding>
@ -153,7 +159,7 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/goarch_api/lectionary.py"> <entry file="file://$PROJECT_DIR$/goarch_api/lectionary.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="174"> <state relative-caret-position="1472">
<caret line="69" column="63" selection-start-line="69" selection-start-column="63" selection-end-line="69" selection-end-column="63" /> <caret line="69" column="63" selection-start-line="69" selection-start-column="63" selection-end-line="69" selection-end-column="63" />
<folding> <folding>
<element signature="e#0#9#0" expanded="true" /> <element signature="e#0#9#0" expanded="true" />
@ -198,9 +204,9 @@
<option value="$PROJECT_DIR$/goarch_api/models.py" /> <option value="$PROJECT_DIR$/goarch_api/models.py" />
<option value="$PROJECT_DIR$/LICENSE.txt" /> <option value="$PROJECT_DIR$/LICENSE.txt" />
<option value="$PROJECT_DIR$/README.md" /> <option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/goarch_api/saint.py" />
<option value="$PROJECT_DIR$/goarch_api/lectionary.py" /> <option value="$PROJECT_DIR$/goarch_api/lectionary.py" />
<option value="$PROJECT_DIR$/goarch_api/daily.py" /> <option value="$PROJECT_DIR$/goarch_api/daily.py" />
<option value="$PROJECT_DIR$/goarch_api/saint.py" />
<option value="$PROJECT_DIR$/setup.py" /> <option value="$PROJECT_DIR$/setup.py" />
<option value="$PROJECT_DIR$/goarch_api/client.py" /> <option value="$PROJECT_DIR$/goarch_api/client.py" />
</list> </list>
@ -363,7 +369,7 @@
<frame x="54" y="27" width="1312" height="741" extended-state="6" /> <frame x="54" y="27" width="1312" height="741" extended-state="6" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.8172839" visible="true" weight="0.24980605" /> <window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.8172839" visible="true" weight="0.24980605" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" /> <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" sideWeight="0.18271606" side_tool="true" weight="0.24980605" /> <window_info id="Favorites" order="2" sideWeight="0.18271606" side_tool="true" weight="0.24980605" />
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
@ -375,7 +381,7 @@
<window_info anchor="bottom" id="TODO" order="6" weight="0.3294702" /> <window_info anchor="bottom" id="TODO" order="6" weight="0.3294702" />
<window_info anchor="bottom" id="Thumbnails" order="7" weight="0.3294702" /> <window_info anchor="bottom" id="Thumbnails" order="7" weight="0.3294702" />
<window_info anchor="bottom" id="Version Control" order="8" /> <window_info anchor="bottom" id="Version Control" order="8" />
<window_info active="true" anchor="bottom" id="Terminal" order="9" visible="true" weight="0.3305648" /> <window_info anchor="bottom" id="Terminal" order="9" visible="true" weight="0.3305648" />
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" /> <window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
<window_info anchor="bottom" id="Python Console" order="11" weight="0.3294702" /> <window_info anchor="bottom" id="Python Console" order="11" weight="0.3294702" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" /> <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
@ -394,16 +400,6 @@
<entry file="file://$PROJECT_DIR$/src/goarch_api/translation.py" /> <entry file="file://$PROJECT_DIR$/src/goarch_api/translation.py" />
<entry file="file://$PROJECT_DIR$/src/goarch_api/reading.py" /> <entry file="file://$PROJECT_DIR$/src/goarch_api/reading.py" />
<entry file="file://$PROJECT_DIR$/src/test_all.py" /> <entry file="file://$PROJECT_DIR$/src/test_all.py" />
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="161">
<caret line="7" selection-start-line="7" selection-end-line="7" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore"> <entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3082"> <state relative-caret-position="3082">
@ -421,12 +417,9 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/goarch_api/models.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/goarch_api/lectionary.py"> <entry file="file://$PROJECT_DIR$/goarch_api/lectionary.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="174"> <state relative-caret-position="1472">
<caret line="69" column="63" selection-start-line="69" selection-start-column="63" selection-end-line="69" selection-end-column="63" /> <caret line="69" column="63" selection-start-line="69" selection-start-column="63" selection-end-line="69" selection-end-column="63" />
<folding> <folding>
<element signature="e#0#9#0" expanded="true" /> <element signature="e#0#9#0" expanded="true" />
@ -435,19 +428,16 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/goarch_api/saint.py"> <entry file="file://$PROJECT_DIR$/goarch_api/models.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="220"> <state relative-caret-position="23">
<caret line="17" column="66" selection-start-line="17" selection-start-column="66" selection-end-line="17" selection-end-column="66" /> <caret line="41" column="23" lean-forward="true" selection-start-line="41" selection-start-column="23" selection-end-line="41" selection-end-column="23" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/goarch_api/daily.py"> <entry file="file://$PROJECT_DIR$/goarch_api/daily.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="174"> <state relative-caret-position="289">
<caret line="62" column="51" selection-start-line="62" selection-start-column="51" selection-end-line="62" selection-end-column="51" /> <caret line="62" column="51" selection-start-line="62" selection-start-column="51" selection-end-line="62" selection-end-column="51" />
<folding> <folding>
<element signature="e#0#22#0" expanded="true" /> <element signature="e#0#22#0" expanded="true" />
@ -457,6 +447,26 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/goarch_api/saint.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="138">
<caret line="36" column="36" lean-forward="true" selection-start-line="36" selection-start-column="36" selection-end-line="36" selection-end-column="36" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="161">
<caret line="7" selection-start-line="7" selection-end-line="7" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/setup.py"> <entry file="file://$PROJECT_DIR$/setup.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="92"> <state relative-caret-position="92">
@ -466,12 +476,12 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/goarch_api/client.py"> <entry file="file://$PROJECT_DIR$/goarch_api/client.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="161"> <state relative-caret-position="36">
<caret line="7" lean-forward="true" selection-start-line="7" selection-end-line="7" /> <caret line="8" column="79" selection-start-line="8" selection-start-column="79" selection-end-line="8" selection-end-column="79" />
<folding> <folding>
<element signature="e#0#15#0" expanded="true" /> <element signature="e#0#15#0" expanded="true" />
<marker date="1535039169428" expanded="true" signature="46:47" ph="..." /> <marker date="1535100009297" expanded="true" signature="46:47" ph="..." />
<marker date="1535039169428" expanded="true" signature="46:51" ph="..." /> <marker date="1535100009297" expanded="true" signature="46:51" ph="..." />
</folding> </folding>
</state> </state>
</provider> </provider>

View File

@ -6,7 +6,7 @@ class HTTPClient:
def __init__(self): def __init__(self):
self.session = requests.session() self.session = requests.session()
user_agent = 'goarch_api (https://github.com/Oikonomia/goarch_api 1.0.2), Python/' user_agent = 'goarch_api (https://github.com/Oikonomia/goarch_api 1.0.4), Python/'
self.user_agent = f"{user_agent}{sys.version_info[0]}.{sys.version_info[1]}" self.user_agent = f"{user_agent}{sys.version_info[0]}.{sys.version_info[1]}"
def request(self, method, path): def request(self, method, path):

View File

@ -1,6 +1,7 @@
import re import re
from lxml import etree from lxml import etree
import html
from goarch_api.client import HTTPClient from goarch_api.client import HTTPClient
from goarch_api.models import Translation, LectionaryReading, Icon, Hymn from goarch_api.models import Translation, LectionaryReading, Icon, Hymn
@ -8,7 +9,7 @@ from goarch_api.models import Translation, LectionaryReading, Icon, Hymn
def remove_html_tags(raw): def remove_html_tags(raw):
regex = re.compile('<.*?>') regex = re.compile('<.*?>')
return re.sub(regex, " ", raw) return html.unescape(re.sub(regex, " ", raw))
class Saint: class Saint:
@ -37,7 +38,7 @@ class Saint:
file_path = icon.find("filepath").text file_path = icon.find("filepath").text
_copyright = icon.find("copyright").text _copyright = icon.find("copyright").text
converted_icon = Icon(_id, file_path, _copyright) converted_icon = Icon(file_path, _copyright, _id=_id)
self.icons.append(converted_icon) self.icons.append(converted_icon)

View File

@ -2,7 +2,7 @@ from setuptools import setup
setup( setup(
name="goarch_api", name="goarch_api",
version="1.0.2", version="1.0.4",
author="Elliott Pardee", author="Elliott Pardee",
author_email="me@vypr.xyz", author_email="me@vypr.xyz",
url="https://github.com/Oikonomia/goarch_api", url="https://github.com/Oikonomia/goarch_api",