Skip to content

Commit

Permalink
Update lexicons fetched from 905743d committed 2023-12-20T14:49:21Z (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX authored Dec 21, 2023
1 parent c515652 commit ba0a47d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
10 changes: 10 additions & 0 deletions fetch_new_lexicon.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ def _write_extracted_lexicons(extracted_files: ExtractedFiles) -> None:
_write_to_file(_format_lexicon_filename(filename), content)


def _remove_all_files_from_lexicons_folder() -> None:
for file in _FOLDER_TO_WRITE_LEXICONS.iterdir():
file.unlink()


def main() -> None:
sha, commit_date, _ = _get_last_commit_info()

Expand All @@ -120,6 +125,11 @@ def main() -> None:
print('- Commit with the message below:', end='\n\n')

print(f'Update lexicons fetched from {sha[:7]} committed {commit_date}')

# in case if some lexicons were deleted
_remove_all_files_from_lexicons_folder()
# TODO(MarshalX): remove generated files likes models, etc.

_write_extracted_lexicons(_extract_zip(_download_zip_with_code()))


Expand Down
4 changes: 4 additions & 0 deletions lexicons/com.atproto.admin.defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,10 @@
"subjectLine": {
"type": "string",
"description": "The subject line of the email sent to the user."
},
"comment": {
"type": "string",
"description": "Additional comment about the outgoing comm."
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion lexicons/com.atproto.admin.sendEmail.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
"recipientDid": { "type": "string", "format": "did" },
"content": { "type": "string" },
"subject": { "type": "string" },
"senderDid": { "type": "string", "format": "did" }
"senderDid": { "type": "string", "format": "did" },
"comment": {
"type": "string",
"description": "Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers"
}
}
}
},
Expand Down
1 change: 1 addition & 0 deletions packages/atproto_client/models/com/atproto/admin/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ class ModEventEmail(base.ModelBase):
"""Definition model for :obj:`com.atproto.admin.defs`. Keep a log of outgoing email to a user"""

subject_line: str = Field(alias='subjectLine') #: The subject line of the email sent to the user.
comment: t.Optional[str] = None #: Additional comment about the outgoing comm.

py_type: te.Literal['com.atproto.admin.defs#modEventEmail'] = Field(
default='com.atproto.admin.defs#modEventEmail', alias='$type', frozen=True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ class Data(base.DataModelBase):
content: str #: Content.
recipient_did: str = Field(alias='recipientDid') #: Recipient did.
sender_did: str = Field(alias='senderDid') #: Sender did.
comment: t.Optional[
str
] = None #: Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers.
subject: t.Optional[str] = None #: Subject.


class DataDict(te.TypedDict):
content: str #: Content.
recipient_did: str #: Recipient did.
sender_did: str #: Sender did.
comment: te.NotRequired[
t.Optional[str]
] #: Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers.
subject: te.NotRequired[t.Optional[str]] #: Subject.


Expand Down

0 comments on commit ba0a47d

Please sign in to comment.