gbp.git.modifier.GitModifier(object) class documentationgbp.git.modifier
(View In Hierarchy)
Stores authorship/committer information
| Method | __init__ | No summary |
| Instance Variable | name | Undocumented |
| Instance Variable | Undocumented | |
| Method | get_date | Return date as a git raw date |
| Method | set_date | Set date from timestamp, git raw date or datetime object |
| Class Variable | date | Undocumented |
| Method | datetime | Return the date as datetime object |
| Method | tz_offset | Return the date's UTC offset |
| Method | get_author_env | Get env vars for authorship information |
| Method | get_committer_env | Get env vars for committer information |
| Method | get | Undocumented |
| Method | __getitem__ | Undocumented |
| Static Method | keys | Undocumented |
| Method | items | Undocumented |
| Method | _parse_date | Undocumented |
| Instance Variable | _date | Undocumented |
| Method | _get_env | Get author or committer information as env var dictionary |
| Parameters | name | the modifier's name (type: str) |
the modifier's email (type: str) | ||
| date | the date of the modification (type: str (git raw date), int (timestamp) or datetime object) |
Get env vars for authorship information
>>> g = GitModifier("Joey Ramone", "joey@example.com") >>> g.get_author_env()['GIT_AUTHOR_EMAIL'] 'joey@example.com' >>> g.get_author_env()['GIT_AUTHOR_NAME'] 'Joey Ramone'
| Returns | Author information suitable to use as environment variables (type: dict) | |
Get env vars for committer information
>>> g = GitModifier("Joey Ramone", "joey@example.com") >>> g.get_committer_env()['GIT_COMMITTER_EMAIL'] 'joey@example.com' >>> g.get_committer_env()['GIT_COMMITTER_NAME'] 'Joey Ramone'
| Returns | Committer information suitable to use as environment variables (type: dict) | |