(
self,
path: Union[str, os.PathLike[str]],
rev_id: str,
message: Optional[str],
create_date: datetime.datetime,
)
| 772 | return script |
| 773 | |
| 774 | def _rev_path( |
| 775 | self, |
| 776 | path: Union[str, os.PathLike[str]], |
| 777 | rev_id: str, |
| 778 | message: Optional[str], |
| 779 | create_date: datetime.datetime, |
| 780 | ) -> Path: |
| 781 | epoch = int(create_date.timestamp()) |
| 782 | slug = "_".join(_slug_re.findall(message or "")).lower() |
| 783 | if len(slug) > self.truncate_slug_length: |
| 784 | slug = slug[: self.truncate_slug_length].rsplit("_", 1)[0] + "_" |
| 785 | filename = "%s.py" % ( |
| 786 | self.file_template |
| 787 | % { |
| 788 | "rev": rev_id, |
| 789 | "slug": slug, |
| 790 | "epoch": epoch, |
| 791 | "year": create_date.year, |
| 792 | "month": create_date.month, |
| 793 | "day": create_date.day, |
| 794 | "hour": create_date.hour, |
| 795 | "minute": create_date.minute, |
| 796 | "second": create_date.second, |
| 797 | } |
| 798 | ) |
| 799 | return Path(path) / filename |
| 800 | |
| 801 | |
| 802 | class Script(revision.Revision): |
no outgoing calls