File tree Expand file tree Collapse file tree 3 files changed +45
-5
lines changed
Expand file tree Collapse file tree 3 files changed +45
-5
lines changed Original file line number Diff line number Diff line change 77from .bones .image import ImageBone , ImageBoneRelSkel
88from .modules .assistant import Assistant
99from .skeletons .assistant import AssistantSkel
10+ from .bones .actions import BONE_ACTION_KEY , BoneAction
1011from .config import CONFIG
1112
1213__all__ = [
1314 "Assistant" ,
15+ "BONE_ACTION_KEY" ,
16+ "BoneAction" ,
1417 "CONFIG" ,
1518 "ImageBone" ,
1619 "ImageBoneRelSkel" ,
Original file line number Diff line number Diff line change 1+ """
2+ Bone Actions
3+
4+ This module defines identifiers as they are used in vi-admin
5+ to activate certain additional actions on a bone.
6+
7+ Examples:
8+ ~~~~~~~~~
9+
10+ .. code-block:: python
11+
12+ descr = TextBone(
13+ languages=["de", "en"],
14+ params={
15+ BONE_ACTION_KEY: [BoneAction.TRANSLATE],
16+ },
17+ )
18+
19+ descr = ImageBone(
20+ params={
21+ BONE_ACTION_KEY: [BoneAction.DESCRIBE_IMAGE],
22+ },
23+ )
24+ """
25+
26+ import typing as t
27+
28+ BONE_ACTION_KEY : t .Final [str ] = "actions"
29+ """The key of the parameter"""
30+
31+
32+ class BoneAction :
33+ TRANSLATE : t .Final [str ] = "translate"
34+ """Translate text"""
35+
36+ DESCRIBE_IMAGE : t .Final [str ] = "describe_image"
37+ """Describe image with an alt text"""
Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ class ImageBone(FileBone):
1818 type = FileBone .type + ".image"
1919
2020 def __init__ (
21- self ,
22- * ,
23- using : t .Optional [RelSkel ] = ImageBoneRelSkel ,
24- validMimeTypes : None | t .Iterable [str ] = [ "image/*" ] ,
25- ** kwargs ,
21+ self ,
22+ * ,
23+ using : t .Type [RelSkel ] = ImageBoneRelSkel ,
24+ validMimeTypes : None | t .Iterable [str ] = ( "image/*" ,) ,
25+ ** kwargs ,
2626 ):
2727 super ().__init__ (
2828 using = using ,
You can’t perform that action at this time.
0 commit comments