roboherd 0.1.6__tar.gz → 0.1.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of roboherd might be problematic. Click here for more details.
- {roboherd-0.1.6 → roboherd-0.1.7}/.woodpecker/test.yml +1 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/.woodpecker/website.yml +1 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/CHANGES.md +5 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/PKG-INFO +1 -1
- roboherd-0.1.7/docs/main.md +3 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/mkdocs.yml +2 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/pyproject.toml +1 -1
- {roboherd-0.1.6 → roboherd-0.1.7}/resources/docker/Dockerfile +2 -2
- roboherd-0.1.7/roboherd/__init__.py +25 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/cow/__init__.py +8 -0
- roboherd-0.1.7/roboherd/examples/dev_null.py +10 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/examples/json_echo.py +6 -11
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/examples/moocow.py +6 -10
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/examples/number.py +5 -10
- roboherd-0.1.7/roboherd/examples/rooster.py +16 -0
- roboherd-0.1.7/roboherd/examples/scarecrow.py +23 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/uv.lock +3 -3
- roboherd-0.1.6/roboherd/examples/__init__.py +0 -0
- roboherd-0.1.6/roboherd/examples/dev_null.py +0 -13
- roboherd-0.1.6/roboherd/examples/rooster.py +0 -22
- roboherd-0.1.6/roboherd/examples/scarecrow.py +0 -27
- {roboherd-0.1.6 → roboherd-0.1.7}/.gitignore +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/.woodpecker/create_release.yml +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/.woodpecker/publish_docker.yml +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/.woodpecker/publish_pypi.yml +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/README.md +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/docs/annotations.md +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/docs/assets/bull-horns.png +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/docs/assets/mastodon.png +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/docs/cli.md +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/docs/cow.md +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/docs/herd.md +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/docs/index.md +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/docs/util.md +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/resources/docker/build.sh +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/__main__.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/annotations/__init__.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/annotations/bovine.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/annotations/common.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/cow/const.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/cow/handlers.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/cow/profile.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/cow/test_handlers.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/cow/test_init.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/cow/test_profile.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/cow/test_util.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/cow/types.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/cow/util.py +0 -0
- {roboherd-0.1.6/roboherd → roboherd-0.1.7/roboherd/examples}/__init__.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/examples/meta.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/__init__.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/builder.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/manager/__init__.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/manager/config.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/manager/load.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/manager/test_config.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/manager/test_load.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/manager/test_manager.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/processor.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/scheduler.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/test_herd.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/test_scheduler.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/herd/types.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/register.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/test_validators.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/util.py +0 -0
- {roboherd-0.1.6 → roboherd-0.1.7}/roboherd/validators.py +0 -0
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changes to roboherd
|
|
2
2
|
|
|
3
|
+
## 0.1.7 ([Milestone](https://codeberg.org/bovine/roboherd/milestone/10741))
|
|
4
|
+
|
|
5
|
+
- Repair docker file [roboherd#38](https://codeberg.org/bovine/roboherd/issues/38)
|
|
6
|
+
- Simplify imports and creating a RoboCow [roboherd#39](https://codeberg.org/bovine/roboherd/issues/39)
|
|
7
|
+
|
|
3
8
|
## 0.1.6 ([Milestone](https://codeberg.org/bovine/roboherd/milestone/10694))
|
|
4
9
|
|
|
5
10
|
- Comment on python path [roboherd#34](https://codeberg.org/bovine/roboherd/issues/34)
|
|
@@ -59,8 +59,10 @@ plugins:
|
|
|
59
59
|
- griffe_fieldz: { include_inherited: true }
|
|
60
60
|
nav:
|
|
61
61
|
- Home: index.md
|
|
62
|
+
- "Changes": CHANGES.md
|
|
62
63
|
- "Commang Line Tool": cli.md
|
|
63
64
|
- "References":
|
|
65
|
+
- "roboherd": main.md
|
|
64
66
|
- "roboherd.annotations": annotations.md
|
|
65
67
|
- "roboherd.cow": cow.md
|
|
66
68
|
- "roboherd.herd": herd.md
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Main roboherd module. Should contain all necessary elements to build a robocow"""
|
|
2
|
+
|
|
3
|
+
from .cow import RoboCow
|
|
4
|
+
from .annotations import (
|
|
5
|
+
PublishObject,
|
|
6
|
+
PublishActivity,
|
|
7
|
+
RawData,
|
|
8
|
+
ParsedData,
|
|
9
|
+
Activity,
|
|
10
|
+
EmbeddedObject,
|
|
11
|
+
)
|
|
12
|
+
from .annotations.bovine import MarkdownPoster, ObjectFactory, ActivityFactory
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"RoboCow",
|
|
16
|
+
"RawData",
|
|
17
|
+
"ParsedData",
|
|
18
|
+
"Activity",
|
|
19
|
+
"EmbeddedObject",
|
|
20
|
+
"MarkdownPoster",
|
|
21
|
+
"ActivityFactory",
|
|
22
|
+
"ObjectFactory",
|
|
23
|
+
"PublishObject",
|
|
24
|
+
"PublishActivity",
|
|
25
|
+
]
|
|
@@ -81,6 +81,14 @@ class RoboCow:
|
|
|
81
81
|
metadata=dict(description="Internal data for the cow"),
|
|
82
82
|
)
|
|
83
83
|
|
|
84
|
+
@staticmethod
|
|
85
|
+
def create(**kwargs):
|
|
86
|
+
"""Creates a new cow. We note that
|
|
87
|
+
`RoboCow.create(name="my name")` is equivalent
|
|
88
|
+
to `RoboCow(information=Information(name="my name"))`.
|
|
89
|
+
"""
|
|
90
|
+
return RoboCow(information=Information(**kwargs))
|
|
91
|
+
|
|
84
92
|
def action(self, action: str = "*", activity_type: str = "*"):
|
|
85
93
|
"""Adds a handler for an event. Use "*" as a wildcard.
|
|
86
94
|
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import json
|
|
2
2
|
|
|
3
|
-
from roboherd
|
|
4
|
-
from roboherd.annotations import RawData, PublishObject
|
|
5
|
-
from roboherd.annotations.bovine import ObjectFactory
|
|
3
|
+
from roboherd import RoboCow, RawData, PublishObject, ObjectFactory
|
|
6
4
|
|
|
7
|
-
from roboherd.cow.types import Information
|
|
8
5
|
from .meta import meta_information
|
|
9
6
|
|
|
10
|
-
bot = RoboCow(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
description="""<p>I'm a silly bot that replies to
|
|
7
|
+
bot = RoboCow.create(
|
|
8
|
+
handle="jsonecho",
|
|
9
|
+
name="JSON Echo {}",
|
|
10
|
+
description="""<p>I'm a silly bot that replies to
|
|
15
11
|
you with the JSON as received through a HTTP
|
|
16
12
|
post request by
|
|
17
13
|
<a href="https://codeberg.org/helge/cattle_grid">cattle_grid</a>.</p>
|
|
18
14
|
|
|
19
15
|
""",
|
|
20
|
-
|
|
21
|
-
)
|
|
16
|
+
meta_information=meta_information,
|
|
22
17
|
)
|
|
23
18
|
|
|
24
19
|
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
from roboherd
|
|
4
|
-
from roboherd.annotations import EmbeddedObject, PublishObject
|
|
5
|
-
from roboherd.cow.types import Information
|
|
3
|
+
from roboherd import RoboCow, EmbeddedObject, PublishObject
|
|
6
4
|
from .meta import meta_information
|
|
7
5
|
|
|
8
6
|
logger = logging.getLogger(__name__)
|
|
9
7
|
|
|
10
|
-
moocow = RoboCow(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
description="""I'm a cow that likes to moo.
|
|
8
|
+
moocow = RoboCow.create(
|
|
9
|
+
handle="moocow",
|
|
10
|
+
name="The mooing cow 🐮",
|
|
11
|
+
description="""I'm a cow that likes to moo.
|
|
15
12
|
|
|
16
13
|
I also serve as an example for the RoboHerd python tool.
|
|
17
14
|
See <a href="https://codeberg.org/helge/roboherd">codeberg.org</a>.""",
|
|
18
|
-
|
|
19
|
-
)
|
|
15
|
+
meta_information=meta_information,
|
|
20
16
|
)
|
|
21
17
|
|
|
22
18
|
|
|
@@ -3,10 +3,7 @@ from urllib.parse import urlparse
|
|
|
3
3
|
|
|
4
4
|
from almabtrieb import Almabtrieb
|
|
5
5
|
|
|
6
|
-
from roboherd
|
|
7
|
-
from roboherd.annotations import PublishObject
|
|
8
|
-
from roboherd.annotations.bovine import ObjectFactory
|
|
9
|
-
from roboherd.cow.types import Information
|
|
6
|
+
from roboherd import RoboCow, PublishObject, ObjectFactory
|
|
10
7
|
from .meta import meta_information
|
|
11
8
|
|
|
12
9
|
|
|
@@ -14,14 +11,12 @@ def hostname(actor_id):
|
|
|
14
11
|
return urlparse(actor_id).netloc
|
|
15
12
|
|
|
16
13
|
|
|
17
|
-
bot = RoboCow(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
description="""<p>I'm a bot by Helge. I post a random number every hour. When posting an even number, I change my Fediverse handle to even. When posting an odd one, I use odd.</p>
|
|
14
|
+
bot = RoboCow.create(
|
|
15
|
+
handle="even",
|
|
16
|
+
description="""<p>I'm a bot by Helge. I post a random number every hour. When posting an even number, I change my Fediverse handle to even. When posting an odd one, I use odd.</p>
|
|
21
17
|
|
|
22
18
|
<p>I also update my name. I'm not sure how you should display my handle with your Fediverse application. Please write a FEP explaining it.</p>""",
|
|
23
|
-
|
|
24
|
-
)
|
|
19
|
+
meta_information=meta_information,
|
|
25
20
|
)
|
|
26
21
|
|
|
27
22
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from roboherd import RoboCow, PublishObject, ObjectFactory
|
|
2
|
+
|
|
3
|
+
from .meta import meta_information
|
|
4
|
+
|
|
5
|
+
bot = RoboCow.create(
|
|
6
|
+
handle="rooster",
|
|
7
|
+
name="The crowing rooster 🐓",
|
|
8
|
+
meta_information=meta_information,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@bot.cron("42 * * * *")
|
|
13
|
+
async def crow(publisher: PublishObject, object_factory: ObjectFactory):
|
|
14
|
+
await publisher(
|
|
15
|
+
object_factory.note(content="cock-a-doodle-doo").as_public().build() # type: ignore
|
|
16
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from roboherd import RoboCow, MarkdownPoster
|
|
2
|
+
|
|
3
|
+
# from roboherd import PublishObject, ObjectFactory
|
|
4
|
+
|
|
5
|
+
from .meta import meta_information
|
|
6
|
+
|
|
7
|
+
bot = RoboCow.create(
|
|
8
|
+
name="The scare crow 👩🌾",
|
|
9
|
+
description="""On startup I scare crows""",
|
|
10
|
+
handle="scarecrow",
|
|
11
|
+
meta_information=meta_information,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# @bot.startup
|
|
16
|
+
# async def startup(publish_object: PublishObject, object_factory: ObjectFactory):
|
|
17
|
+
# note = object_factory.note(content="Booo! 🐦").as_public().build() # type: ignore
|
|
18
|
+
# await publish_object(note)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@bot.startup
|
|
22
|
+
async def startup(poster: MarkdownPoster):
|
|
23
|
+
await poster("__Booo!__ 🐦")
|
|
@@ -15,11 +15,11 @@ wheels = [
|
|
|
15
15
|
|
|
16
16
|
[[package]]
|
|
17
17
|
name = "aiohappyeyeballs"
|
|
18
|
-
version = "2.4.
|
|
18
|
+
version = "2.4.8"
|
|
19
19
|
source = { registry = "https://pypi.org/simple" }
|
|
20
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
20
|
+
sdist = { url = "https://files.pythonhosted.org/packages/de/7c/79a15272e88d2563c9d63599fa59f05778975f35b255bf8f90c8b12b4ada/aiohappyeyeballs-2.4.8.tar.gz", hash = "sha256:19728772cb12263077982d2f55453babd8bec6a052a926cd5c0c42796da8bf62", size = 22337 }
|
|
21
21
|
wheels = [
|
|
22
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
22
|
+
{ url = "https://files.pythonhosted.org/packages/52/0e/b187e2bb3eeb2644515109657c4474d65a84e7123de249bf1e8467d04a65/aiohappyeyeballs-2.4.8-py3-none-any.whl", hash = "sha256:6cac4f5dd6e34a9644e69cf9021ef679e4394f54e58a183056d12009e42ea9e3", size = 15005 },
|
|
23
23
|
]
|
|
24
24
|
|
|
25
25
|
[[package]]
|
|
File without changes
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from roboherd.cow import RoboCow
|
|
2
|
-
from roboherd.cow.types import Information
|
|
3
|
-
|
|
4
|
-
from .meta import meta_information
|
|
5
|
-
|
|
6
|
-
bot = RoboCow(
|
|
7
|
-
information=Information(
|
|
8
|
-
name="/dev/null",
|
|
9
|
-
description="""I don't do anything.""",
|
|
10
|
-
handle="devnull",
|
|
11
|
-
meta_information=meta_information,
|
|
12
|
-
)
|
|
13
|
-
)
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
from roboherd.cow import RoboCow
|
|
2
|
-
from roboherd.cow.types import Information
|
|
3
|
-
|
|
4
|
-
from roboherd.annotations import PublishObject
|
|
5
|
-
from roboherd.annotations.bovine import ObjectFactory
|
|
6
|
-
|
|
7
|
-
from .meta import meta_information
|
|
8
|
-
|
|
9
|
-
bot = RoboCow(
|
|
10
|
-
information=Information(
|
|
11
|
-
handle="rooster",
|
|
12
|
-
name="The crowing rooster 🐓",
|
|
13
|
-
meta_information=meta_information,
|
|
14
|
-
)
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@bot.cron("42 * * * *")
|
|
19
|
-
async def crow(publisher: PublishObject, object_factory: ObjectFactory):
|
|
20
|
-
await publisher(
|
|
21
|
-
object_factory.note(content="cock-a-doodle-doo").as_public().build() # type: ignore
|
|
22
|
-
)
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from roboherd.cow import RoboCow
|
|
2
|
-
from roboherd.cow.types import Information
|
|
3
|
-
|
|
4
|
-
from roboherd.annotations import PublishObject
|
|
5
|
-
from roboherd.annotations.bovine import ObjectFactory
|
|
6
|
-
|
|
7
|
-
from .meta import meta_information
|
|
8
|
-
|
|
9
|
-
bot = RoboCow(
|
|
10
|
-
information=Information(
|
|
11
|
-
name="The scare crow 👩🌾",
|
|
12
|
-
description="""On startup I scare crows""",
|
|
13
|
-
handle="scarecrow",
|
|
14
|
-
meta_information=meta_information,
|
|
15
|
-
)
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@bot.startup
|
|
20
|
-
async def startup(publish_object: PublishObject, object_factory: ObjectFactory):
|
|
21
|
-
note = object_factory.note(content="Booo! 🐦").as_public().build() # type: ignore
|
|
22
|
-
await publish_object(note)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# @bot.startup
|
|
26
|
-
# async def startup(poster: MarkdownPoster):
|
|
27
|
-
# await poster("__Booo!__ 🐦")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|