diff options
| author | 2024-06-26 09:20:15 +0800 | |
|---|---|---|
| committer | 2024-06-26 09:20:15 +0800 | |
| commit | dcadac73813291a86a4ab3aca44706fc9b8e3b5e (patch) | |
| tree | 44aaffb958b1375c0124f93fe8079205e9453b85 | |
| parent | a2477b28057251c4685dbf0b56359dee7b595bfa (diff) | |
| download | HydroRollCore-dcadac73813291a86a4ab3aca44706fc9b8e3b5e.tar.gz HydroRollCore-dcadac73813291a86a4ab3aca44706fc9b8e3b5e.zip | |
chore(docs): add structures.svg and contributing guidance
| -rw-r--r-- | .vscode/settings.json | 3 | ||||
| -rw-r--r-- | CONTRIBUTING.rst | 8 | ||||
| -rw-r--r-- | docs/_static/.$Structures.svg.bkp | 42 | ||||
| -rw-r--r-- | docs/_static/.$Structures.svg.dtmp | 4 | ||||
| -rw-r--r-- | docs/_static/Structures.svg | 4 | ||||
| -rw-r--r-- | docs/source/index.rst | 8 | ||||
| -rw-r--r-- | docs/source/pages/contributing.rst | 2 | ||||
| -rw-r--r-- | hrc/__init__.py | 2 | ||||
| -rw-r--r-- | hrc/rules/BaseRule/CharacterCard.py | 22 | ||||
| -rw-r--r-- | hrc/rules/BaseRule/__init__.py | 13 | ||||
| -rw-r--r-- | hrc/rules/__init__.py | 12 | ||||
| -rw-r--r-- | hrc/rules/py.typed (renamed from hrc/rule_package.py) | 0 | ||||
| -rw-r--r-- | hrc/typing.py | 7 | ||||
| -rw-r--r-- | tests/test_BRP_pdfquery.py | 2 | ||||
| -rw-r--r-- | tests/test_BaseRule.py | 28 |
15 files changed, 132 insertions, 25 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json index 9e5ca18..414a2fa 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { "restructuredtext.preview.name": "sphinx", - "iis.configDir": "" + "iis.configDir": "", + "livePreview.defaultPreviewPath": "/docs/_build/html/index.html" }
\ No newline at end of file diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 0000000..8cd8d29 --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,8 @@ +CONTRIBUTING +============ + +How to commit with PullRequest? +------------------------------- + +How to open an issue? +---------------------
\ No newline at end of file diff --git a/docs/_static/.$Structures.svg.bkp b/docs/_static/.$Structures.svg.bkp new file mode 100644 index 0000000..723359b --- /dev/null +++ b/docs/_static/.$Structures.svg.bkp @@ -0,0 +1,42 @@ +<mxfile> + <diagram id="prtHgNgQTEPvFCAcTncT" name="Page-1"> + <mxGraphModel dx="1223" dy="871" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> + <root> + <mxCell id="0" /> + <mxCell id="1" parent="0" /> + <mxCell id="dNxyNK7c78bLwvsdeMH5-11" value="Orgchart" style="swimlane;html=1;startSize=20;horizontal=1;containerType=tree;glass=0;" parent="1" vertex="1"> + <mxGeometry x="40" y="80" width="710" height="290" as="geometry" /> + </mxCell> + <UserObject label="%name%<br><i style="color: gray">%position%</i><br><a href="mailto:%email%">Email</a>" name="Tessa Miller" position="CFO" location="Office 1" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-12"> + <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeMoving=1;treeFolding=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> + <mxGeometry x="260" y="50" width="180" height="70" as="geometry" /> + </mxCell> + </UserObject> + <mxCell id="dNxyNK7c78bLwvsdeMH5-13" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-14" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <UserObject label="%name%<br><i style="color: gray">%position%</i><br><a href="mailto:%email%">Email</a>" name="Edward Morrison" position="Brand Manager" location="Office 2" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-14"> + <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeFolding=1;treeMoving=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> + <mxGeometry x="40" y="180" width="180" height="80" as="geometry" /> + </mxCell> + </UserObject> + <mxCell id="dNxyNK7c78bLwvsdeMH5-15" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-16" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <UserObject label="%name%<br><i style="color: gray">%position%</i><br><a href="mailto:%email%">Email</a>" name="Evan Valet" position="HR Director" location="Office 4" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-16"> + <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeFolding=1;treeMoving=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> + <mxGeometry x="260" y="180" width="180" height="80" as="geometry" /> + </mxCell> + </UserObject> + <mxCell id="dNxyNK7c78bLwvsdeMH5-17" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-18" edge="1"> + <mxGeometry relative="1" as="geometry" /> + </mxCell> + <UserObject label="%name%<br><i style="color: gray">%position%</i><br><a href="mailto:%email%">Email</a>" name="Alison Donovan" position="System Admin" location="Office 3" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-18"> + <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> + <mxGeometry x="490" y="180" width="180" height="80" as="geometry" /> + </mxCell> + </UserObject> + </root> + </mxGraphModel> + </diagram> +</mxfile> diff --git a/docs/_static/.$Structures.svg.dtmp b/docs/_static/.$Structures.svg.dtmp new file mode 100644 index 0000000..26247d9 --- /dev/null +++ b/docs/_static/.$Structures.svg.dtmp @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Do not edit this file with editors other than draw.io --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="571px" height="301px" viewBox="-0.5 -0.5 571 301" content="<mxfile host="Electron" modified="2024-06-26T01:01:45.575Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.6.1 Chrome/124.0.6367.207 Electron/30.0.6 Safari/537.36" version="24.6.1" etag="pZS_4PXEmtHSB9fLTIs3" type="device" pages="2"> <diagram id="prtHgNgQTEPvFCAcTncT" name="Page-1"> <mxGraphModel dx="1877" dy="649" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> <root> <mxCell id="0" /> <mxCell id="1" parent="0" /> <mxCell id="dNxyNK7c78bLwvsdeMH5-11" value="Orgchart" style="swimlane;html=1;startSize=20;horizontal=1;containerType=tree;glass=0;" parent="1" vertex="1"> <mxGeometry x="-40" y="150" width="710" height="290" as="geometry" /> </mxCell> <UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Tessa Miller" position="CFO" location="Office 1" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-12"> <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeMoving=1;treeFolding=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> <mxGeometry x="260" y="50" width="180" height="70" as="geometry" /> </mxCell> </UserObject> <mxCell id="dNxyNK7c78bLwvsdeMH5-13" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-14" edge="1"> <mxGeometry relative="1" as="geometry" /> </mxCell> <UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Edward Morrison" position="Brand Manager" location="Office 2" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-14"> <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeFolding=1;treeMoving=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> <mxGeometry x="40" y="180" width="180" height="80" as="geometry" /> </mxCell> </UserObject> <mxCell id="dNxyNK7c78bLwvsdeMH5-15" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-16" edge="1"> <mxGeometry relative="1" as="geometry" /> </mxCell> <UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Evan Valet" position="HR Director" location="Office 4" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-16"> <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeFolding=1;treeMoving=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> <mxGeometry x="260" y="180" width="180" height="80" as="geometry" /> </mxCell> </UserObject> <mxCell id="dNxyNK7c78bLwvsdeMH5-17" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-18" edge="1"> <mxGeometry relative="1" as="geometry" /> </mxCell> <UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Alison Donovan" position="System Admin" location="Office 3" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-18"> <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> <mxGeometry x="490" y="180" width="180" height="80" as="geometry" /> </mxCell> </UserObject> </root> </mxGraphModel> </diagram> <diagram name="Page-1 的副本" id="QUBPRxTMLXw4AuhHwJvm"> <mxGraphModel dx="840" dy="519" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> <root> <mxCell id="tazqR-jlQMPDV_MZ-rYC-0" /> <mxCell id="tazqR-jlQMPDV_MZ-rYC-1" parent="tazqR-jlQMPDV_MZ-rYC-0" /> <mxCell id="VPFQTBCB0J-yRa51enEa-0" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="tazqR-jlQMPDV_MZ-rYC-1"> <mxGeometry x="140" y="660" width="570" height="300" as="geometry" /> </mxCell> </root> </mxGraphModel> </diagram> </mxfile> "><defs/><g><g data-cell-id="tazqR-jlQMPDV_MZ-rYC-0"><g data-cell-id="tazqR-jlQMPDV_MZ-rYC-1"><g data-cell-id="VPFQTBCB0J-yRa51enEa-0"><g><rect x="0" y="0" width="570" height="300" fill="rgb(24, 20, 29)" stroke="rgb(240, 240, 240)" pointer-events="all"/></g></g></g></g></g></svg>
\ No newline at end of file diff --git a/docs/_static/Structures.svg b/docs/_static/Structures.svg new file mode 100644 index 0000000..674f55e --- /dev/null +++ b/docs/_static/Structures.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Do not edit this file with editors other than draw.io --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="711px" height="291px" viewBox="-0.5 -0.5 711 291" content="<mxfile host="Electron" modified="2024-06-25T13:25:08.853Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.6.1 Chrome/124.0.6367.207 Electron/30.0.6 Safari/537.36" version="24.6.1" etag="ly8nYDkHCcTHrMA4GDsg" type="device" pages="2"> <diagram id="prtHgNgQTEPvFCAcTncT" name="Page-1"> <mxGraphModel dx="1877" dy="649" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> <root> <mxCell id="0" /> <mxCell id="1" parent="0" /> <mxCell id="dNxyNK7c78bLwvsdeMH5-11" value="Orgchart" style="swimlane;html=1;startSize=20;horizontal=1;containerType=tree;glass=0;" parent="1" vertex="1"> <mxGeometry x="-40" y="150" width="710" height="290" as="geometry" /> </mxCell> <UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Tessa Miller" position="CFO" location="Office 1" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-12"> <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeMoving=1;treeFolding=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> <mxGeometry x="260" y="50" width="180" height="70" as="geometry" /> </mxCell> </UserObject> <mxCell id="dNxyNK7c78bLwvsdeMH5-13" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-14" edge="1"> <mxGeometry relative="1" as="geometry" /> </mxCell> <UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Edward Morrison" position="Brand Manager" location="Office 2" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-14"> <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeFolding=1;treeMoving=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> <mxGeometry x="40" y="180" width="180" height="80" as="geometry" /> </mxCell> </UserObject> <mxCell id="dNxyNK7c78bLwvsdeMH5-15" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-16" edge="1"> <mxGeometry relative="1" as="geometry" /> </mxCell> <UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Evan Valet" position="HR Director" location="Office 4" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-16"> <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;treeFolding=1;treeMoving=1;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> <mxGeometry x="260" y="180" width="180" height="80" as="geometry" /> </mxCell> </UserObject> <mxCell id="dNxyNK7c78bLwvsdeMH5-17" value="" style="endArrow=blockThin;endFill=1;fontSize=11;edgeStyle=elbowEdgeStyle;elbow=vertical;rounded=0;" parent="dNxyNK7c78bLwvsdeMH5-11" source="dNxyNK7c78bLwvsdeMH5-12" target="dNxyNK7c78bLwvsdeMH5-18" edge="1"> <mxGeometry relative="1" as="geometry" /> </mxCell> <UserObject label="%name%&lt;br&gt;&lt;i style=&quot;color: gray&quot;&gt;%position%&lt;/i&gt;&lt;br&gt;&lt;a href=&quot;mailto:%email%&quot;&gt;Email&lt;/a&gt;" name="Alison Donovan" position="System Admin" location="Office 3" email="me@example.com" placeholders="1" link="https://www.draw.io" id="dNxyNK7c78bLwvsdeMH5-18"> <mxCell style="label;image=https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png;whiteSpace=wrap;html=1;rounded=0;glass=0;" parent="dNxyNK7c78bLwvsdeMH5-11" vertex="1"> <mxGeometry x="490" y="180" width="180" height="80" as="geometry" /> </mxCell> </UserObject> </root> </mxGraphModel> </diagram> <diagram name="Page-1 的副本" id="QUBPRxTMLXw4AuhHwJvm"> <mxGraphModel dx="840" dy="519" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> <root> <mxCell id="tazqR-jlQMPDV_MZ-rYC-0" /> <mxCell id="tazqR-jlQMPDV_MZ-rYC-1" parent="tazqR-jlQMPDV_MZ-rYC-0" /> <mxCell id="VPFQTBCB0J-yRa51enEa-0" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="tazqR-jlQMPDV_MZ-rYC-1"> <mxGeometry x="140" y="660" width="570" height="300" as="geometry" /> </mxCell> </root> </mxGraphModel> </diagram> </mxfile> "><defs/><g><g data-cell-id="0"><g data-cell-id="1"><g data-cell-id="dNxyNK7c78bLwvsdeMH5-11"><g><path d="M 0 20 L 0 0 L 710 0 L 710 20" fill="rgb(24, 20, 29)" stroke="rgb(240, 240, 240)" stroke-miterlimit="10" pointer-events="all"/><path d="M 0 20 L 0 290 L 710 290 L 710 20" fill="none" stroke="rgb(240, 240, 240)" stroke-miterlimit="10" pointer-events="none"/><path d="M 0 20 L 710 20" fill="none" stroke="rgb(240, 240, 240)" stroke-miterlimit="10" pointer-events="none"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 10px; margin-left: 355px;"><div data-drawio-colors="color: rgb(240, 240, 240); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(240, 240, 240); line-height: 1.2; pointer-events: all; font-weight: bold; white-space: nowrap;">Orgchart</div></div></div></foreignObject><text x="355" y="14" fill="rgb(240, 240, 240)" font-family=""Helvetica"" font-size="12px" text-anchor="middle" font-weight="bold">Orgchart</text></switch></g></g><g data-cell-id="dNxyNK7c78bLwvsdeMH5-12"><a xlink:href="https://www.draw.io"><g><rect x="260" y="50" width="180" height="70" fill="rgb(24, 20, 29)" stroke="rgb(240, 240, 240)" pointer-events="all"/><image x="266.5" y="63.5" width="42" height="42" xlink:href="https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png" preserveAspectRatio="none"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 126px; height: 1px; padding-top: 85px; margin-left: 314px;"><div data-drawio-colors="color: rgb(240, 240, 240); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(240, 240, 240); line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; overflow-wrap: normal;">Tessa Miller<br /><i style="color: gray">CFO</i><br /><a href="mailto:me@example.com">Email</a></div></div></div></foreignObject><text x="314" y="89" fill="rgb(240, 240, 240)" font-family=""Helvetica"" font-size="12px" font-weight="bold">Tessa Miller...</text></switch></g></g></a></g><g data-cell-id="dNxyNK7c78bLwvsdeMH5-13"><g><path d="M 350 120 L 350 150 L 130 150 L 130 171.88" fill="none" stroke="rgb(240, 240, 240)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 130 178.88 L 127.67 171.88 L 132.33 171.88 Z" fill="rgb(240, 240, 240)" stroke="rgb(240, 240, 240)" stroke-miterlimit="10" pointer-events="all"/></g></g><g data-cell-id="dNxyNK7c78bLwvsdeMH5-14"><a xlink:href="https://www.draw.io"><g><rect x="40" y="180" width="180" height="80" fill="rgb(24, 20, 29)" stroke="rgb(240, 240, 240)" pointer-events="all"/><image x="46.5" y="198.5" width="42" height="42" xlink:href="https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png" preserveAspectRatio="none"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 126px; height: 1px; padding-top: 220px; margin-left: 94px;"><div data-drawio-colors="color: rgb(240, 240, 240); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(240, 240, 240); line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; overflow-wrap: normal;">Edward Morrison<br /><i style="color: gray">Brand Manager</i><br /><a href="mailto:me@example.com">Email</a></div></div></div></foreignObject><text x="94" y="224" fill="rgb(240, 240, 240)" font-family=""Helvetica"" font-size="12px" font-weight="bold">Edward Morrison...</text></switch></g></g></a></g><g data-cell-id="dNxyNK7c78bLwvsdeMH5-15"><g><path d="M 350 120 L 350 150 L 350 171.88" fill="none" stroke="rgb(240, 240, 240)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 350 178.88 L 347.67 171.88 L 352.33 171.88 Z" fill="rgb(240, 240, 240)" stroke="rgb(240, 240, 240)" stroke-miterlimit="10" pointer-events="all"/></g></g><g data-cell-id="dNxyNK7c78bLwvsdeMH5-16"><a xlink:href="https://www.draw.io"><g><rect x="260" y="180" width="180" height="80" fill="rgb(24, 20, 29)" stroke="rgb(240, 240, 240)" pointer-events="all"/><image x="266.5" y="198.5" width="42" height="42" xlink:href="https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png" preserveAspectRatio="none"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 126px; height: 1px; padding-top: 220px; margin-left: 314px;"><div data-drawio-colors="color: rgb(240, 240, 240); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(240, 240, 240); line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; overflow-wrap: normal;">Evan Valet<br /><i style="color: gray">HR Director</i><br /><a href="mailto:me@example.com">Email</a></div></div></div></foreignObject><text x="314" y="224" fill="rgb(240, 240, 240)" font-family=""Helvetica"" font-size="12px" font-weight="bold">Evan Valet...</text></switch></g></g></a></g><g data-cell-id="dNxyNK7c78bLwvsdeMH5-17"><g><path d="M 350 120 L 350 150 L 580 150 L 580 171.88" fill="none" stroke="rgb(240, 240, 240)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 580 178.88 L 577.67 171.88 L 582.33 171.88 Z" fill="rgb(240, 240, 240)" stroke="rgb(240, 240, 240)" stroke-miterlimit="10" pointer-events="all"/></g></g><g data-cell-id="dNxyNK7c78bLwvsdeMH5-18"><a xlink:href="https://www.draw.io"><g><rect x="490" y="180" width="180" height="80" fill="rgb(24, 20, 29)" stroke="rgb(240, 240, 240)" pointer-events="all"/><image x="496.5" y="198.5" width="42" height="42" xlink:href="https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png" preserveAspectRatio="none"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe flex-start; width: 126px; height: 1px; padding-top: 220px; margin-left: 544px;"><div data-drawio-colors="color: rgb(240, 240, 240); " style="box-sizing: border-box; font-size: 0px; text-align: left;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(240, 240, 240); line-height: 1.2; pointer-events: all; font-weight: bold; white-space: normal; overflow-wrap: normal;">Alison Donovan<br /><i style="color: gray">System Admin</i><br /><a href="mailto:me@example.com">Email</a></div></div></div></foreignObject><text x="544" y="224" fill="rgb(240, 240, 240)" font-family=""Helvetica"" font-size="12px" font-weight="bold">Alison Donovan...</text></switch></g></g></a></g></g></g></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
\ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index efda5f6..8f98453 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,7 +1,7 @@ .. hide-toc: true HydroRollCore -========= +============== .. include:: ../../README.rst :start-after: .. index-start @@ -11,13 +11,13 @@ HydroRollCore .. toctree:: :hidden: - Quick start <pages/quick-start.rst> + 快速开始 <pages/quick-start.rst> .. toctree:: :caption: Development :hidden: - CONTRIBUTING <pages/development/contributing.rst> - CHANGELOG <changelog.rst> + 贡献指南 <pages/contributing.rst> + 变更日志 <changelog.rst> COPYING <COPYING.rst>
\ No newline at end of file diff --git a/docs/source/pages/contributing.rst b/docs/source/pages/contributing.rst index 64b74a9..4e5383d 100644 --- a/docs/source/pages/contributing.rst +++ b/docs/source/pages/contributing.rst @@ -1 +1 @@ -.. include:: ../../../CONTRIBUTING.md
\ No newline at end of file +.. include:: ../../../CONTRIBUTING.rst
\ No newline at end of file diff --git a/hrc/__init__.py b/hrc/__init__.py index 6c6b22c..b8a3bde 100644 --- a/hrc/__init__.py +++ b/hrc/__init__.py @@ -1,2 +1,4 @@ from .LibCore import * + from . import rules +# from . import
\ No newline at end of file diff --git a/hrc/rules/BaseRule/CharacterCard.py b/hrc/rules/BaseRule/CharacterCard.py new file mode 100644 index 0000000..6d09e5a --- /dev/null +++ b/hrc/rules/BaseRule/CharacterCard.py @@ -0,0 +1,22 @@ +import dataclasses +from dataclasses import dataclass +from typing import Literal, Optional, Union + + +@dataclass +class Custom(object): + """Docstring for Custom.""" + property: type + + +class Attribute(Custom): + ... + + +class Skill(Custom): + ... + + +class Information(Custom): + ... + diff --git a/hrc/rules/BaseRule/__init__.py b/hrc/rules/BaseRule/__init__.py index 4d3bc9d..c30e24a 100644 --- a/hrc/rules/BaseRule/__init__.py +++ b/hrc/rules/BaseRule/__init__.py @@ -3,18 +3,7 @@ from dataclasses import dataclass from typing import Literal, Optional, Union from . import JudgeRule - -@dataclass -class CharacterCard(object): - """Docstring for CharacterCard.""" - property: type - - class Information(object): - age: Optional[Union[int, str]] - race: Optional[str] - gender: Optional[str] - group: Optional[str] - +from . import CharacterCard @dataclass class CustomRule(object): diff --git a/hrc/rules/__init__.py b/hrc/rules/__init__.py index be96d47..ccd3dbc 100644 --- a/hrc/rules/__init__.py +++ b/hrc/rules/__init__.py @@ -1 +1,11 @@ -from . import BaseRule
\ No newline at end of file +from typing import Generic, Any, Type + +from abc import ABC + +from . import BaseRule +from ..typing import RulesT + + +class Rules(ABC, Generic[RulesT]): + ... +
\ No newline at end of file diff --git a/hrc/rule_package.py b/hrc/rules/py.typed index e69de29..e69de29 100644 --- a/hrc/rule_package.py +++ b/hrc/rules/py.typed diff --git a/hrc/typing.py b/hrc/typing.py index e69de29..b3ced30 100644 --- a/hrc/typing.py +++ b/hrc/typing.py @@ -0,0 +1,7 @@ +from typing import TypeVar, Generic, Any, TYPE_CHECKING, Awaitable, Callable, Optional + +if TYPE_CHECKING: + from .rules import Rules + + +RulesT = TypeVar("RulesT", bound="Rules[Any]")
\ No newline at end of file diff --git a/tests/test_BRP_pdfquery.py b/tests/test_BRP_pdfquery.py index 453e471..bda7bd1 100644 --- a/tests/test_BRP_pdfquery.py +++ b/tests/test_BRP_pdfquery.py @@ -3,4 +3,4 @@ from pdfquery import PDFQuery pdf = PDFQuery("../rule_book/BRP SRD 1.0 CHN.pdf") pdf.load() -print(pdf.get_page(1)) +print([dir(x) for x in dir(pdf.get_page(1))]) diff --git a/tests/test_BaseRule.py b/tests/test_BaseRule.py index f450c28..da5ac93 100644 --- a/tests/test_BaseRule.py +++ b/tests/test_BaseRule.py @@ -57,13 +57,31 @@ __rule_book__ = "BASIC ROLEPLAYING" # ============================================== # MyRule -from hrc.rules.BaseRule import JudgeRule +import hrc +from hrc.rules import BaseRule, Rules +from hrc.rules.BaseRule import CharacterCard, JudgeRule -class JudgeAttr(JudgeRule.Attribute): - """来自判定规则 - 属性判定 - 属性判定规则(模式)""" +class JudgeAttr(JudgeRule.Attribute): + """属性判定规则""" class JudgeCustom(JudgeRule.Custom): - ... + """自定义判定规则""" + + +class ChaAttr(CharacterCard.Attribute): + """人物卡属性列表""" + + +class ChaSkill(CharacterCard.Skill): + """人物卡技能列表""" + + +class ThePool(Rules[JudgeAttr, JudgeCustom]): + """规则包[池]""" + + __config__ = 'ThePool' + + +
\ No newline at end of file |
